55件ヒット
[1-55件を表示]
(0.069秒)
検索結果
先頭5件
-
TracePoint
# disable -> bool (18226.0) -
self のトレースを無効にします。
...返します。そうでなければ false を返します)
//emlist[例][ruby]{
trace.enabled? # => true
trace.disable # => false (実行前の状態)
trace.enabled? # => false
trace.disable # => false
//}
ブロックが与えられた場合、ブロック内でのみトレースが無効に......=> true
trace.disable do
trace.enabled? # => false
end
trace.enabled? # => true
//}
[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
trace.enable { p trace.lineno }
# =>... -
TracePoint
# disable { . . . } -> object (18226.0) -
self のトレースを無効にします。
...返します。そうでなければ false を返します)
//emlist[例][ruby]{
trace.enabled? # => true
trace.disable # => false (実行前の状態)
trace.enabled? # => false
trace.disable # => false
//}
ブロックが与えられた場合、ブロック内でのみトレースが無効に......=> true
trace.disable do
trace.enabled? # => false
end
trace.enabled? # => true
//}
[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
trace.enable { p trace.lineno }
# =>... -
TracePoint
. new(*events) {|obj| . . . } -> TracePoint (130.0) -
新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。
...|tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end
# => #<TracePoint:0x007f17372cdb20>
trace.enable
# => false
puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}
トレースを無効にするには TracePoint#disable を実行し......てください。
//emlist[][ruby]{
trace.disable
//}
@param events トレースするイベントを String か Symbol で任
意の数指定します。
: :line
式の評価。
: :class
クラス定義、特異クラス定義、モジュール定義への突入。
: :end......を実行した場合には
RuntimeError が発生します。
//emlist[例][ruby]{
TracePoint.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not supported by this event
//}
イベントフックの外側で、発生したイベントに関連する情報... -
TracePoint
# enable -> bool (112.0) -
self のトレースを有効にします。
...そうでなければ false を返します)
//emlist[例][ruby]{
trace.enabled? # => false
trace.enable # => false (実行前の状態)
# トレースが有効
trace.enabled? # => true
trace.enable # => true (実行前の状態)
# 引き続きトレースが有効
//}
ブロックが......ace.enabled? # => true
end
trace.enabled? # => false
//}
[注意] イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: a......ccess from outside
//}
@see TracePoint#disable, TracePoint#enabled?... -
TracePoint
# enable { . . . } -> object (112.0) -
self のトレースを有効にします。
...そうでなければ false を返します)
//emlist[例][ruby]{
trace.enabled? # => false
trace.enable # => false (実行前の状態)
# トレースが有効
trace.enabled? # => true
trace.enable # => true (実行前の状態)
# 引き続きトレースが有効
//}
ブロックが......ace.enabled? # => true
end
trace.enabled? # => false
//}
[注意] イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: a......ccess from outside
//}
@see TracePoint#disable, TracePoint#enabled?...