るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle type_size_t

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 3 > >>

TracePoint#path -> String (6113.0)

イベントが発生したファイルのパスを返します。

...トが発生したファイルのパスを返します。

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

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

TracePoint#return_value -> object (6113.0)

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

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

//emlist[例][ruby]{
def foo(ret)
ret
end
t
race = TracePoint.new(:return) do |tp|
p tp.return_value # => 1
end
t
race.enable
foo 1...

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

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

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

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

t
race.disable do
t
race.enabled? # => false
end

t
race.enabled? # => true
//}

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

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

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

TracePoint#lineno -> Integer (3113.0)

発生したイベントの行番号を返します。

...発生したイベントの行番号を返します。

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

//emlist[例][ruby]{
def foo(ret)
ret
end
t
race = TracePoint.new(:call, :return) do |tp|
t
p.lineno
end
t
race.enable
foo 1
# => 1
# 3
//}...

TracePoint#defined_class -> Class | module (3043.0)

メソッドを定義したクラスかモジュールを返します。

...//emlist[例][ruby]{
class C; def foo; end; end
t
race = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}

メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します。

//emlist[例][ruby]{
modul...
...d; end
class C; include M; end;
t
race = TracePoint.new(:call) do |tp|
p tp.defined_class # => M
end.enable do
C.new.foo
end
//}

[注意] 特異メソッドを実行した場合は TracePoint#defined_class は特異クラ
スを返します。また、Kernel.#set_trace_func の 6 番目のブロ...
...ではなく元のクラスを返します。

//emlist[例][ruby]{
class C; def self.foo; end; end
t
race = TracePoint.new(:call) do |tp|
p tp.defined_class # => #<Class:C>
end.enable do
C.foo
end
//}

Kernel.#set_trace_func と TracePoint の上記の差分に注意して
ください。

@see...

絞り込み条件を変える

TracePoint#disable -> bool (3025.0)

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

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

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

t
race.disable do
t
race.enabled? # => false
end

t
race.enabled? # => true
//}

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

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

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

TracePoint#binding -> Binding (3013.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...発生したイベントによって生成された Binding オブジェクトを返します。


//emlist[例][ruby]{
def foo(ret)
ret
end
t
race = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
t
race.enable
foo 1
//}...

TracePoint#binding -> Binding | nil (3013.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...は binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//emlist[例][ruby]{
def foo(ret)
ret
end
t
race = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
t
race.enable
foo 1
//}...

TracePoint#callee_id -> Symbol | nil (3013.0)

イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。

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

//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end

t
race = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
end
t
race.enable do...
...C.new.alias_name
end
//}

@see TracePoint#method_id...

BigDecimal#coerce(other) -> Array (125.0)

self と other が同じクラスになるよう、self か other を変換し [other, self] という配列にして返します。

...self と other が同じクラスになるよう、self か other を変換し [other,
self] という配列にして返します。

@param other 比較または変換するオブジェクト

BigDecimal#coerce は Ruby における強制型変換のための機能です。
BigDecimal オブジェ...
...ブジェクト間の各種の計算は
BigDecimal#coerce の結果を元に行われます。

//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("1.0")
b = a / 2.0 # => 0.5e0
//}

other に Rational オブジェクトを指定した場合は self の有効桁数を
用いて変換を行いま...
...す。

数値を表す文字列から BigDecimal オブジェクトに変換する機能はデフォ
ルトでは無効になっています。必要な場合は ENABLE_NUMERIC_STRING を有効に
して Ruby をコンパイルしてください。...

絞り込み条件を変える

<< < 1 2 3 > >>