るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.061秒)
トップページ > クエリ:String#tr[x] > クエリ:Format[x] > クラス:NameError[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. service drb::extserv#stop_service
  5. inspect? irb::context#inspect_mode

ライブラリ

検索結果

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