るりまサーチ

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

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. pstore path

ライブラリ

検索結果

Thread::Backtrace::Location#to_s -> String (18142.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...ームを Kernel.#caller と同じ表現にした文字列を返し
ます。

//emlist[例][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.to_s
end

# => path/to/foo.rb:...
...5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...