種類
- インスタンスメソッド (437)
- モジュール関数 (155)
- 特異メソッド (108)
- クラス (22)
ライブラリ
- ビルトイン (722)
クラス
- BasicObject (22)
- Exception (7)
- Hash (11)
- Method (82)
- Module (11)
- Object (22)
- Proc (74)
- Symbol (11)
- SystemCallError (44)
- Thread (54)
-
Thread
:: Backtrace :: Location (44) - TracePoint (96)
- UnboundMethod (15)
モジュール
- Enumerable (44)
- Kernel (155)
-
RubyVM
:: AbstractSyntaxTree (8)
キーワード
- << (12)
- === (29)
- >> (12)
- Location (11)
- Method (11)
- [] (22)
-
_ _ callee _ _ (11) - abort (10)
-
absolute
_ path (11) -
add
_ trace _ func (11) -
base
_ label (11) - bind (5)
-
bind
_ call (10) -
callee
_ id (11) - caller (33)
-
caller
_ locations (22) - curry (20)
-
default
_ proc (11) -
defined
_ class (11) - detect (22)
- event (11)
- fail (11)
- find (22)
- inspect (11)
-
instance
_ eval (22) -
instance
_ method (11) - lambda (17)
- lineno (11)
- method (11)
-
method
_ id (11) - new (62)
- parameters (6)
-
parse
_ file (8) - path (11)
- proc (18)
- raise (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) - self (2)
-
set
_ trace _ func (22) -
singleton
_ method (11) -
super
_ method (10) - syscall (11)
-
to
_ proc (11) -
to
_ s (11) - trace (11)
- yield (11)
検索結果
先頭5件
-
Method
# call(*args) -> object (23132.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called... -
Method
# call(*args) { . . . } -> object (23132.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called... -
Method
# call(*args) -> object (23126.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...せん。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2... -
Method
# call(*args) { . . . } -> object (23126.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...せん。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2... -
Method
# call(*args) -> object (23120.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...りません。
@param args self に渡される引数。
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
/... -
Method
# call(*args) { . . . } -> object (23120.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...りません。
@param args self に渡される引数。
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
/... -
Proc
# call(*arg) -> () (23113.0) -
手続きオブジェクトを実行してその結果を返します。
...|
case n
when 0 then 0
when 1 then 1
else
fib.(n - 2) + fib.(n - 1)
end
}
fib.(10) # => 55
//}
@param arg 手続きオブジェクトに与える引数を指定します。
@raise LocalJumpError Procを生成したメソッドからリターンしてしまった場合に発生し... -
Kernel
. # syscall(num , *arg) -> Integer (14130.0) -
numで指定された番号のシステムコールを実行します。 第2引数以降をシステムコールの引数として渡します。
...て渡します。
どの数値がどのシステムコールに対応するかは、
syscall(2) や
/usr/include/sys/syscall.h を参照してください。
システムコールの慣習に従い、syscall(2)
が -1 を返す場合には例外 Errno::EXXX が発生します。
それ以外で......高レベルな操作ができます。
@param num システムコール番号です。
@param arg 文字列か、整数です。最大 9 個まで渡すことができます。
@raise Errno::EXXX syscall(2) が -1 を返した場合に発生します。
@raise NotImplementedError 実行環境が......このメソッドに対応していないとき発生します。
//emlist[例][ruby]{
syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box
# => hello
//}
@see fiddle, syscall(2freebsd), syscall(2linux)... -
UnboundMethod
# bind _ call(recv , *args) -> object (14126.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
UnboundMethod
# bind _ call(recv , *args) { . . . } -> object (14126.0) -
self を recv に bind して args を引数として呼び出します。
...self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call... -
Kernel
. # caller(range) -> [String] | nil (14124.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した......ます。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#......set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:... -
Kernel
. # caller(start = 1) -> [String] | nil (14124.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した......ます。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#......set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:... -
Kernel
. # caller(start , length) -> [String] | nil (14124.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した......ます。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#......set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (14124.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...す。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取得したいフレームの範囲を示す Range オブジェ......y]{
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)
# => ["......(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... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (14124.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...す。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取得したいフレームの範囲を示す Range オブジェ......y]{
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)
# => ["......(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...