種類
- インスタンスメソッド (224)
- モジュール関数 (110)
- 特異メソッド (55)
- 文書 (33)
ライブラリ
- ビルトイン (235)
- irb (11)
-
net
/ http (11) - objspace (44)
- psych (22)
-
rexml
/ sax2listener (11) -
webrick
/ httputils (55)
クラス
- Array (44)
- MatchData (70)
-
Net
:: HTTP (11) - Thread (22)
-
WEBrick
:: HTTPUtils :: FormData (55)
モジュール
- GC (22)
-
GC
:: Profiler (11) - IRB (11)
- Kernel (55)
- ObjectSpace (55)
- Psych (22)
-
REXML
:: SAX2Listener (11)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) - [] (88)
-
allocation
_ sourcefile (11) -
allocation
_ sourceline (11) -
backtrace
_ locations (22) - byteoffset (4)
- caller (33)
-
caller
_ locations (22) - filename (11)
- filename= (11)
-
garbage
_ collect (22) - head (11)
- load (11)
- name (11)
- name= (11)
- offset (22)
- parse (11)
-
raw
_ data (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
start
_ element (11) -
trace
_ object _ allocations _ start (11) -
trace
_ object _ allocations _ stop (11)
検索結果
先頭5件
-
GC
. start(full _ mark: true , immediate _ sweep: true) -> nil (18320.0) -
ガーベージコレクトを開始します。
...GC が禁止されている場合は何もしません。
nil を返します。
@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true を指定します。
@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合......す。将来のバージョンとの互換性も保証されません。また、Ruby の実装がサポー
トしていない場合はキーワード引数を指定しても無視される可能性があります。
//emlist[例][ruby]{
GC.count # => 3
GC.start # => nil
GC.count # => 4
//}......場合でもガベージコレクトを開始します。
nil を返します。
@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true を指定します。
@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合... -
IRB
. start(ap _ path = nil) -> () (18302.0) -
IRB を初期化して、トップレベルの irb を開始します。
...IRB を初期化して、トップレベルの irb を開始します。
@param ap_path irb コマンドのパスを指定します。... -
Array
# at(nth) -> object | nil (15244.0) -
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
...nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
@param nth インデックスを整数で指定します。
先頭の要素が 0 番目になります。nth の値が負の時には末尾から
のインデックス......みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [ "a", "b", "c", "d", "e" ]
a[0] #=> "a"
a[1] #=> "b"
a[-1] #=> "e"
a[-2] #=> "d"
a[10] #=> nil
//}... -
ObjectSpace
. # trace _ object _ allocations _ start -> nil (12302.0) -
オブジェクト割り当てのトレースを開始します。
...オブジェクト割り当てのトレースを開始します。
@see ObjectSpace.#trace_object_allocations_stop... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6568.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/U......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6516.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...ドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param......します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"......]
//}
@see Thread::Backtrace::Location... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6368.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/U......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6316.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...ドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param......します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"......]
//}
@see Thread::Backtrace::Location... -
MatchData
# byteoffset(name) -> [Integer , Integer] | [nil , nil] (6247.0) -
name という名前付きグループに対応する部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。
...グループに対応する部分文字列のバイト単位のオフセットの
配列 [start, end] を返します。
nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。
@param name 名前(シンボルか文字列)
@raise IndexError 正......') # => [0, 4]
p $~.byteoffset(:year) # => [0, 4]
p $~.byteoffset('month') # => [7, 8]
p $~.byteoffset(:month) # => [7, 8]
p $~.byteoffset('day') # => [nil, nil]
p $~.byteoffset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#offset... -
MatchData
# offset(name) -> [Integer , Integer] | [nil , nil] (6247.0) -
name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。
...る部分文字列のオフセットの配列 [start, end] を返
します。
//emlist[例][ruby]{
[ self.begin(name), self.end(name) ]
//}
と同じです。nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。
@param name 名前(シンボ......('year') # => [0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end......0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end, MatchData#offset...