るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.022秒)
トップページ > クラス:TracePoint[x] > クエリ:RuntimeError[x] > クエリ:lineno[x] > バージョン:2.1.0[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

TracePoint#lineno -> Integer (54343.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.new(*events) {|obj| ... } -> TracePoint (112.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...
...t]
end
# => #<TracePoint:0x007f17372cdb20>

trace.enable
# => false

puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}

トレースを無効にするには TracePoint#disable を実行してください。

//emlist[][ruby]{
trace.disable
//}

@param...
...ベントに関連しない情報を取得するメソッドを実行した場合には
RuntimeError が発生します。

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

イベントフック...

TracePoint#disable -> bool (58.0)

self のトレースを無効にします。

...self のトレースを無効にします。

実行前の TracePoint#enabled? を返します。(トレースが既に有効であっ
た場合は true を返します。そうでなければ false を返します)

//emlist[例][ruby]{
trace.enabled? # => true
trace.disable # => false (実行前...
...true
//}

[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。

trace.enable { p trace.lineno }
# => RuntimeError: access from outside

@see TracePoint#enable, TracePoint#enabled?...

TracePoint#disable { ... } -> object (58.0)

self のトレースを無効にします。

...self のトレースを無効にします。

実行前の TracePoint#enabled? を返します。(トレースが既に有効であっ
た場合は true を返します。そうでなければ false を返します)

//emlist[例][ruby]{
trace.enabled? # => true
trace.disable # => false (実行前...
...true
//}

[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。

trace.enable { p trace.lineno }
# => RuntimeError: access from outside

@see TracePoint#enable, TracePoint#enabled?...

TracePoint#enable -> bool (58.0)

self のトレースを有効にします。

...self のトレースを有効にします。

実行前の TracePoint#enabled? を返します。(トレースが既に有効であっ
た場合は true を返します。そうでなければ false を返します)

//emlist[例][ruby]{
trace.enabled? # => false
trace.enable # => false (実行...
...イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。

//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
//}

@see TracePoint#disable, TracePoint#enabled?...

絞り込み条件を変える

TracePoint#enable { ... } -> object (58.0)

self のトレースを有効にします。

...self のトレースを有効にします。

実行前の TracePoint#enabled? を返します。(トレースが既に有効であっ
た場合は true を返します。そうでなければ false を返します)

//emlist[例][ruby]{
trace.enabled? # => false
trace.enable # => false (実行...
...イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。

//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
//}

@see TracePoint#disable, TracePoint#enabled?...