るりまサーチ

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

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. argf.class to_a
  5. argf.class readline

ライブラリ

検索結果

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

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

...絶対パスを返します。

//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.absolute_path
end

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