るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

キーワード

検索結果

TracePoint#eval_script -> String | nil (14116.0)

script_compiledイベント発生時にコンパイルされたソースコードを返します。 ファイルから読み込んだ場合は、nilを返します。

...ます。
ファイルから読み込んだ場合は、nilを返します。

//emlist[例][ruby]{
TracePoint
.new(:script_compiled) do |tp|
p tp.eval_script # => "puts 'hello'"
end.enable do
eval
("puts 'hello'")
end
//}

@raise RuntimeError :script_compiled イベントのための...

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (8015.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...structionSequenceインスタンスを返します。

//emlist[例][ruby]{
TracePoint
.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval
("puts 'hello'")
end
//}

@raise RuntimeError :script_compiled イベント...

TracePoint#self -> object (8009.0)

イベントを発生させたオブジェクトを返します。

...イベントを発生させたオブジェクトを返します。

以下のようにする事で同じ値を取得できます。


//emlist[例][ruby]{
trace.binding.eval('self')
//}

@see TracePoint#binding...
...返します。

以下のようにする事で同じ値を取得できます。

なお、self メソッドは binding が nil になる :c_call および :c_return イベントに対しても正しく動作します。

//emlist[例][ruby]{
trace.binding.eval('self')
//}

@see TracePoint#binding...