るりまサーチ

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

別のキーワード

  1. _builtin runtimeerror
  2. raise runtimeerror
  3. fail runtimeerror
  4. open runtimeerror
  5. enable runtimeerror

ライブラリ

キーワード

検索結果

<< < 1 2 >>

TracePoint#method_id -> Symbol | nil (8.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_id] # =...
...> [:method_name, :alias_name]
end
trace.enable do
C.new.alias_name
end
//}

@see TracePoint#callee_id...

TracePoint#parameters -> [object] (8.0)

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

...s と同じです。

@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....

TracePoint#path -> String (8.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#raised_exception -> Exception (8.0)

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

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

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

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

TracePoint#return_value -> object (8.0)

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

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

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

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

絞り込み条件を変える

<< < 1 2 >>