るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. comparable >
  4. integer >
  5. module >

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

TracePoint#enable -> bool (24293.0)

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

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

//emlist[例][ruby]{
trace
.enabled? # => false
trace
.enable # => false (実行前の状態)

# トレースが有効

trace
.enabled?...
...# => true
trace
.enable # => true (実行前の状態)

# 引き続きトレースが有効
//}

ブロックが与えられた場合、ブロック内でのみトレースが有効になります。
この場合はブロックの評価結果を返します。

//emlist[例][ruby]{
trace
.enabled?...
...=> false

trace
.enable do
trace
.enabled? # => true
end

trace
.enabled? # => false
//}

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

//emlist[例][ruby]{
trace
.enable { p trace...

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

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

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

//emlist[例][ruby]{
trace
.enabled? # => false
trace
.enable # => false (実行前の状態)

# トレースが有効

trace
.enabled?...
...# => true
trace
.enable # => true (実行前の状態)

# 引き続きトレースが有効
//}

ブロックが与えられた場合、ブロック内でのみトレースが有効になります。
この場合はブロックの評価結果を返します。

//emlist[例][ruby]{
trace
.enabled?...
...=> false

trace
.enable do
trace
.enabled? # => true
end

trace
.enabled? # => false
//}

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

//emlist[例][ruby]{
trace
.enable { p trace...

TracePoint#enabled? -> bool (12207.0)

self のトレースが有効な場合に true を、そうでない場合に false を返しま す。

...self のトレースが有効な場合に true を、そうでない場合に false を返しま
す。


@see TracePoint#enable, TracePoint#disable...

TracePoint#raised_exception -> Exception (9325.0)

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

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

//emlist[例][ruby]{
trace
= TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace
.enable
begin
0/0
rescue
end
//}...

TracePoint#inspect -> String (9225.0)

self の状態を人間に読みやすい文字列にして返します。

...self の状態を人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
def foo(ret)
ret
end
trace
= TracePoint.new(:call) do |tp|
p
tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace
.enable
foo 1
//}...

絞り込み条件を変える

TracePoint#path -> String (9225.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
foo 1
//}...

TracePoint#eval_script -> String | nil (9213.0)

script_compiledイベント発生時にコンパイルされたソースコードを返します。 ファイルから読み込んだ場合は、nilを返します。

...script_compiledイベント発生時にコンパイルされたソースコードを返します。
ファイルから読み込んだ場合は、nilを返します。

//emlist[例][ruby]{
Trace
Point.new(:script_compiled) do |tp|
p
tp.eval_script # => "puts 'hello'"
end.enable do
eval("puts 'he...
...llo'")
end
//}

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

TracePoint#parameters -> [object] (9213.0)

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

...parameters と同じです。

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

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

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

TracePoint#disable -> bool (6179.0)

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

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

//emlist[例][ruby]{
trace
.enabled? # => true
trace
.disable # => false (実行前の状態)
trace
.enabled? # => false
trace
.disable # => fa...
...{
trace
.enabled? # => true

trace
.disable do
trace
.enabled? # => false
end

trace
.enabled? # => true
//}

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

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

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

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

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

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

//emlist[例][ruby]{
trace
.enabled? # => true
trace
.disable # => false (実行前の状態)
trace
.enabled? # => false
trace
.disable # => fa...
...{
trace
.enabled? # => true

trace
.disable do
trace
.enabled? # => false
end

trace
.enabled? # => true
//}

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

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

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

絞り込み条件を変える

<< 1 2 > >>