33件ヒット
[1-33件を表示]
(0.015秒)
ライブラリ
- ビルトイン (33)
検索結果
先頭3件
-
Kernel
. # caller(range) -> [String] | nil (14.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de......)
#=> ["-", 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 (14.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de......)
#=> ["-", 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 (14.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de......)
#=> ["-", 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"]
/...