るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.055秒)
トップページ > クエリ:IO[x] > クエリ:Thread[x] > クエリ:to_s[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. drb thread
  2. thread join
  3. thread exit
  4. thread kill
  5. etc sc_thread_cputime

ライブラリ

検索結果

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

self が表すフレームを 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/fo...

Thread::Backtrace::Location#inspect -> String (6033.0)

Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...
Thread
::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。

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

Foo.new(0..2).loc...
...ations.map do |call|
puts call.inspect
end

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