るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

NameError#to_s -> String (26113.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"
e...

UncaughtThrowError#to_s -> String (26113.0)

self を tag を含む文字列表現にして返します。

...self を tag を含む文字列表現にして返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin

do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}...

Exception#to_s -> String (23107.0)

エラーメッセージをあらわす文字列を返します。

...エラーメッセージをあらわす文字列を返します。

//emlist[例][ruby]{
begin

1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}...

Exception#message -> String (8007.0)

エラーメッセージをあらわす文字列を返します。

...エラーメッセージをあらわす文字列を返します。

//emlist[例][ruby]{
begin

1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}...