ライブラリ
- ビルトイン (193)
- csv (48)
- delegate (12)
- digest (12)
-
irb
/ magic-file (24) - json (24)
- openssl (72)
- prettyprint (24)
- prime (36)
- psych (15)
-
rubygems
/ specification (24) - socket (144)
- tempfile (24)
- uri (12)
- zlib (48)
クラス
- CSV (48)
-
Digest
:: Base (12) - Dir (108)
- File (36)
-
Gem
:: Specification (24) - Integer (12)
-
JSON
:: State (12) -
OpenSSL
:: X509 :: Attribute (24) -
OpenSSL
:: X509 :: Name (48) - PrettyPrint (24)
- Prime (24)
- SimpleDelegator (12)
- Socket (48)
- Tempfile (24)
- Thread (12)
- TracePoint (11)
- UNIXServer (48)
- UNIXSocket (48)
-
Zlib
:: GzipWriter (48)
オブジェクト
-
IRB
:: MagicFile (24)
キーワード
-
array
_ attributes (12) - chdir (36)
- create (24)
-
create
_ id (12) -
default
_ value (12) - each (24)
-
each
_ prime (12) - file (12)
- format (12)
- generate (12)
-
handle
_ interrupt (12) - instance (24)
- join (12)
-
latest
_ gc _ info (24) - load (15)
- new (156)
- open (168)
- parse (12)
-
parse
_ openssl (12) -
parse
_ rfc2253 (12) -
singleline
_ format (12) - stat (13)
- unix (24)
-
unix
_ server _ socket (24) - wrap (24)
検索結果
先頭5件
- Gem
:: Specification . array _ attributes -> Array - GC
. stat(result _ hash = {}) -> {Symbol => Integer} - GC
. latest _ gc _ info(key) -> object - PrettyPrint
. format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object - PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object
-
Gem
:: Specification . array _ attributes -> Array (9207.0) -
@@array_attributes の複製を返します。
...@@array_attributes の複製を返します。
@see Object#dup... -
GC
. stat(result _ hash = {}) -> {Symbol => Integer} (6337.0) -
GC 内部の統計情報を Hash で返します。
...GC.stat
# =>
{
:count=>2,
:heap_used=>9,
:heap_length=>11,
:heap_increment=>2,
:heap_live_slot=>6836,
:heap_free_slot=>519,
:heap_final_slot=>0,
:heap_swept_slot=>818,
:total_allocated_object=>7674,
:total_freed_object=>838,
:malloc_increase=>181034,......:malloc_limit=>16777216,
:minor_gc_count=>2,
:major_gc_count=>0,
:remembered_shady_object=>55,
:remembered_shady_object_limit=>0,
:old_object=>2422,
:old_object_limit=>0,
:oldmalloc_increase=>277386,
:oldmalloc_limit=>16777216
}
戻り値のハッシュは処... -
GC
. latest _ gc _ info(key) -> object (6302.0) -
最新のGCの情報を返します。
...//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}
stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true
GC.latest_gc_info(:gc_by) # => :newobj
//}... -
PrettyPrint
. format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (6302.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 与えられた output を返します。
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
与えられた output を返します。
以下と同じ働きをするもので簡便のために用意されています。
//emlist[][ruby]{
require 'prettyprint'
begin
pp = PrettyPrint.new(output, maxwidth, newline, &genspace)
...
pp.flush
output
end
//}
@param output 出力先を指定します。output は << メソッドを持っていなければなりません。
@param... -
PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (6302.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 PrettyPrint.format に似ていますが、改行しません。
...PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
PrettyPrint.format に似ていますが、改行しません。
引数 maxwidth, newline と genspace は無視されます。ブロック中の breakable の実行は、
改行せずに text... -
Tempfile
. create(basename , *rest) {|fp| . . . } -> object (6302.0) -
テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。 createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
...テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。
createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
ブロックを指定しなかった場合、tmpdir......を引数としてブロックを呼び出します。
ブロック終了時にファイルをクローズするのはopenと同じですが、
createではファイルのunlinkも自動で行います。
@param basename ファイル名のプレフィクスを文字列で指定します。......て使われます。
@param rest Tempfile.newの第二引数以降と同じように扱われます。
@see Tempfile.open
例:
require "tempfile"
GC.disable
path = ""
Tempfile.create("foo") do |f|
path = f.path
p File.exist?(path) #=> true
end
p File.exist?(path) #=> false... -
Tempfile
. create(basename , tmpdir=nil , mode: 0 , **options) {|fp| . . . } -> object (6302.0) -
テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。 createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
...テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。
createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
ブロックを指定しなかった場合、tmpdir......を引数としてブロックを呼び出します。
ブロック終了時にファイルをクローズするのはopenと同じですが、
createではファイルのunlinkも自動で行います。
@param basename ファイル名のプレフィクスを文字列で指定します。......ものが指定できます。ただし、:permオプションは無視され
ます。
@see Tempfile.open
例:
require "tempfile"
GC.disable
path = ""
Tempfile.create("foo") do |f|
path = f.path
p File.exist?(path) #=> true
end
p File.exist?(path) #=> false... -
Tempfile
. create(basename="" , tmpdir=nil , mode: 0 , **options) {|fp| . . . } -> object (6302.0) -
テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。 createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
...テンポラリファイルを作成し、それを表す File オブジェクトを生成して返します(Tempfileではありません)。
createはopenに似ていますが、finalizerによるファイルの自動unlinkを行いません。
ブロックを指定しなかった場合、tmpdir......を引数としてブロックを呼び出します。
ブロック終了時にファイルをクローズするのはopenと同じですが、
createではファイルのunlinkも自動で行います。
@param basename ファイル名のプレフィクスを文字列で指定します。......ものが指定できます。ただし、:permオプションは無視され
ます。
@see Tempfile.open
例:
require "tempfile"
GC.disable
path = ""
Tempfile.create("foo") do |f|
path = f.path
p File.exist?(path) #=> true
end
p File.exist?(path) #=> false... -
TracePoint
. stat -> object (6302.0) -
TracePoint の内部情報を返します。
TracePoint の内部情報を返します。
返り値の内容は実装依存です。
将来変更される可能性があります。
このメソッドは TracePoint 自身のデバッグ用です。 -
GC
. stat(key) -> Numeric (6237.0) -
GC 内部の統計情報を Hash で返します。
...GC.stat
# =>
{
:count=>2,
:heap_used=>9,
:heap_length=>11,
:heap_increment=>2,
:heap_live_slot=>6836,
:heap_free_slot=>519,
:heap_final_slot=>0,
:heap_swept_slot=>818,
:total_allocated_object=>7674,
:total_freed_object=>838,
:malloc_increase=>181034,......:malloc_limit=>16777216,
:minor_gc_count=>2,
:major_gc_count=>0,
:remembered_shady_object=>55,
:remembered_shady_object_limit=>0,
:old_object=>2422,
:old_object_limit=>0,
:oldmalloc_increase=>277386,
:oldmalloc_limit=>16777216
}
戻り値のハッシュは処... -
JSON
. create _ id -> String (6219.0) -
json_create メソッドで使用するクラスを決定するために使用する値を返します。
...reate メソッドで使用するクラスを決定するために使用する値を返します。
デフォルトは "json_class" です。
//emlist[例][ruby]{
require "json"
class User
attr :id, :name
def initialize(id, name)
@id, @name = id, name
end
def self.json_create(object)......new(object['id'], object["name"])
end
def as_json(*)
{
JSON.create_id => self.class.name,
"id" => id,
"name" => name,
}
end
def to_json(*)
as_json.to_json
end
end
json = JSON.generate(User.new(1, "tanaka"))
json # => "{\"json_class\":\"User\",\"id\":1,......\"name\":\"tanaka\"}"
JSON.parse(json, create_additions: true)
# => #<User:0x0000557709b269e0 @id=1, @name="tanaka">
//}... -
CSV
. generate(str = "" , options = Hash . new) {|csv| . . . } -> String (6207.0) -
このメソッドは与えられた文字列をラップして CSV のオブジェクトとしてブロックに渡します。 ブロック内で CSV オブジェクトに行を追加することができます。 ブロックを評価した結果は文字列を返します。
...返します。
このメソッドに与えられた文字列は変更されるので、新しい文字列オブジェクトが必要な
場合は Object#dup で複製してください。
@param str 文字列を指定します。デフォルトは空文字列です。
@param options CSV.new の......,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
csv = CSV.generate(text, headers: true) do |csv|
csv.add_row(["5", "saburo", "kondo", "34"])
end
print csv
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kond......返します。
このメソッドに与えられた文字列は変更されるので、新しい文字列オブジェクトが必要な
場合は Object#dup で複製してください。
@param str 文字列を指定します。デフォルトは空文字列です。
2.5.0 では不... -
GC
. latest _ gc _ info(result _ hash = {}) -> Hash (6202.0) -
最新のGCの情報を返します。
...//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}
stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true
GC.latest_gc_info(:gc_by) # => :newobj
//}...