るりまサーチ

最速Rubyリファレンスマニュアル検索!
23件ヒット [1-23件を表示] (0.086秒)

別のキーワード

  1. socket bind
  2. udpsocket bind
  3. addrinfo bind
  4. etc sc_2_c_bind
  5. resolv-replace bind

ライブラリ

クラス

検索結果

Binding#local_variables -> [Symbol] (21126.0)

ローカル変数の一覧を Symbol の配列で返します。

...カル変数の一覧を Symbol の配列で返します。

//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
bind
ing.local_variables #=> [:a, :n]
end
end
//}

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
bind
ing.eval("local_variables")
//}...

TracePoint#binding -> Binding (6213.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...発生したイベントによって生成された Binding オブジェクトを返します。


//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}...

TracePoint#binding -> Binding | nil (6213.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...によって生成された Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
ret
end
tra...
...ce = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}...