るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. _builtin local_variables
  2. pp pretty_print_instance_variables
  3. win32ole variables
  4. module class_variables
  5. win32ole_type variables

ライブラリ

クラス

検索結果

TracePoint#binding -> Binding (54694.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
//}

Binding#local_variables -> [Symbol] (45379.0)

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

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

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

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

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