るりまサーチ

最速Rubyリファレンスマニュアル検索!
19件ヒット [1-19件を表示] (0.078秒)
トップページ > クエリ:ruby[x] > クエリ:String[x] > クエリ:string[x] > 種類:インスタンスメソッド[x] > クエリ:@[x] > クラス:TracePoint[x]

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. openssl ia5string

ライブラリ

キーワード

検索結果

TracePoint#eval_script -> String | nil (216.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#path -> String (216.0)

イベントが発生したファイルのパスを返します。

...イベントが発生したファイルのパスを返します。

@
raise RuntimeError イベントフックの外側で実行した場合に発生します。

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
fo...