るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.122秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:bind[x] > クエリ:local_variables[x]

別のキーワード

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

ライブラリ

クラス

検索結果

Binding#local_variables -> [Symbol] (27313.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 | nil (6406.0)

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

... Binding オブジェクトを返します。

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

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