48件ヒット
[1-48件を表示]
(0.034秒)
モジュール
- Kernel (48)
キーワード
- caller (36)
-
set
_ trace _ func (12)
検索結果
先頭4件
-
Kernel
. # caller(range) -> [String] | nil (51.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug information"]
//}... -
Kernel
. # caller(start = 1) -> [String] | nil (51.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug information"]
//}... -
Kernel
. # caller(start , length) -> [String] | nil (51.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...=> ["-", 15, "bar"]
# ["-", 19, nil]
# nil
//}
以下は、$DEBUG が真の場合に役に立つ debug 関数
のサンプルです。
//emlist[例][ruby]{
$DEBUG = true
def debug(*args)
p [caller.first, *args] if $DEBUG
end
debug "debug information"
#=> ["-:7", "debug information"]
//}... -
Kernel
. # set _ trace _ func(proc) -> Proc (9.0) -
Ruby インタプリタのイベントをトレースする Proc オブジェクトとして 指定された proc を登録します。 nil を指定するとトレースがオフになります。
...発生する度に、以下で説明する6個の引数とともに
登録された Proc オブジェクトを実行します。
標準添付の debug、tracer、
profile はこの組み込み関数を利用して実現されています。
=== ブロックパラメータの意味
渡す Proc オ...