4件ヒット
[1-4件を表示]
(0.091秒)
検索結果
先頭4件
-
main
. to _ s -> "main" (117664.0) -
"main" を返します。
"main" を返します。 -
main
. inspect -> "main" (81664.0) -
"main" を返します。
"main" を返します。 -
NameError
# to _ s -> String (54400.0) -
例外オブジェクトを文字列に変換して返します。
例外オブジェクトを文字列に変換して返します。
例:
begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"
end -
Thread
:: Backtrace :: Location # inspect -> String (18373.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).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in ...