るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.020秒)
トップページ > クラス:TracePoint[x] > クエリ:raise[x] > クエリ:runtimeerror[x] > クエリ:method_id[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

TracePoint#method_id -> Symbol | nil (18120.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.new(*events) {|obj| ... } -> TracePoint (43.0)

新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。

...新しい TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。

//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.even...
...call

C で記述されたメソッドの呼び出し。

: :c_return

C で記述されたメソッド呼び出しからのリターン。

: :raise

例外の発生。

: :b_call

ブロックの開始。

: :b_return

ブロックの終了。

: :thread_begin

スレッドの開始。...
...][ruby]{
TracePoint
.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not supported by this event
//}

イベントフックの外側で、発生したイベントに関連する情報を取得するメソッ
ドを実行した場合には RuntimeError が発...
...に関連しない情報を取得するメソッドを実行した場合には
RuntimeError
が発生します。

//emlist[例][ruby]{
TracePoint
.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not supported by this event
//}

イベントフックの外側...

TracePoint#callee_id -> Symbol | nil (25.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#method_id...