るりまサーチ

最速Rubyリファレンスマニュアル検索!
231件ヒット [1-100件を表示] (0.140秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > クエリ:caller[x]

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Kernel.#caller(range) -> [String] | nil (18317.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。

@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_fu...
...nc,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

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"...

Kernel.#caller(start = 1) -> [String] | nil (18317.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。

@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_fu...
...nc,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

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"...

Kernel.#caller(start, length) -> [String] | nil (18317.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。

@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_fu...
...nc,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

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:in `<main>'"...

Kernel.#caller_locations(range) -> [Thread::Backtrace::Location] | nil (12326.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...mlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
t
est1(start, length)
end

def test3(start, length)
t
est2(start, length)
end

caller
_locations # => []
t
est3(1...
.../Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
t
est3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9...

Kernel.#caller_locations(start = 1, length = nil) -> [Thread::Backtrace::Location] | nil (12326.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...mlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
t
est1(start, length)
end

def test3(start, length)
t
est2(start, length)
end

caller
_locations # => []
t
est3(1...
.../Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
t
est3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9...

絞り込み条件を変える

SystemCallError (12016.0)

Ruby の実装に用いられているシステムコールまたは一部の C 言語関数が失敗した時に発生する例外です。 システムコールの失敗した原因を表すエラーコードを保持します。

...Ruby の実装に用いられているシステムコールまたは一部の C 言語関数が失敗した時に発生する例外です。
システムコールの失敗した原因を表すエラーコードを保持します。

多くの場合、実際には SystemCallError そのものでは...

Thread::Backtrace::Location#absolute_path -> String (9112.0)

self が表すフレームの絶対パスを返します。

...list[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see Thread::Backtrace::Location...
...#path...

Thread::Backtrace::Location#path -> String (9112.0)

self が表すフレームのファイル名を返します。

...self が表すフレームのファイル名を返します。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}

@see Thread::Backtrace::Location#absolute_path...

Thread#backtrace_locations(range) -> [Thread::Backtrace::Location] | nil (6212.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...トレースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフ...
...nel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
t
hread = Thread.new { sleep 1 }
t
hread.run
t
hread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}

@see Threa...
...d::Backtrace::Location...

Thread#backtrace_locations(start = 0, length = nil) -> [Thread::Backtrace::Location] | nil (6212.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...トレースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフ...
...nel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
t
hread = Thread.new { sleep 1 }
t
hread.run
t
hread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}

@see Threa...
...d::Backtrace::Location...

絞り込み条件を変える

<< 1 2 3 > >>