るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< 1 2 > >>

TracePoint#raised_exception -> Exception (6138.0)

発生した例外を返します。

...発生した例外を返します。

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

//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided...

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

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

...イルされた
Ruby
VM::InstructionSequenceインスタンスを返します。

//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 :sc...

TracePoint#callee_id -> Symbol | nil (32.0)

イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。

...ベルであった場合は nil を返します。

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

//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end

trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_i...
...d] # => [:method_name, :alias_name]
end
trace.enable do
C.new.alias_name
end
//}

@
see TracePoint#method_id...

TracePoint#method_id -> Symbol | nil (32.0)

イベントが発生したメソッドの定義時の名前を Symbol で返します。 トップレベルであった場合は nil を返します。

...ベルであった場合は nil を返します。

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

//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end

trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_i...
...d] # => [:method_name, :alias_name]
end
trace.enable do
C.new.alias_name
end
//}

@
see TracePoint#callee_id...

TracePoint#parameters -> [object] (32.0)

現在のフックが属するメソッドまたはブロックのパラメータ定義を返します。 フォーマットは Method#parameters と同じです。

...eters と同じです。

@
raise RuntimeError :call、:return、:b_call、:b_return、:c_call、:c_return
イベントのためのイベントフックの外側で実行した場合に発生します。

//emlist[例][ruby]{
def foo(a, b = 2)
end
TracePoint
.new(:call) do |tp|
p...
...tp.parameters # => a], [:opt, :b
end.enable do
foo(1)
end
//}

@
see Method#parameters, UnboundMethod#parameters, Proc#parameters...

絞り込み条件を変える

TracePoint#eval_script -> String | nil (26.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#event -> Symbol (26.0)

発生したイベントの種類を Symbol で返します。

...生するイベントの詳細については、TracePoint.new を参照してくださ
い。

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

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call, :return) do |tp|
p tp.event
end
tr...

TracePoint#lineno -> Integer (26.0)

発生したイベントの行番号を返します。

...発生したイベントの行番号を返します。

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

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

TracePoint#path -> String (26.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...

TracePoint#return_value -> object (26.0)

メソッドやブロックの戻り値を返します。

...クの戻り値を返します。

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

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:return) do |tp|
p tp.ret...

絞り込み条件を変える

<< 1 2 > >>