116件ヒット
[101-116件を表示]
(0.103秒)
別のキーワード
ライブラリ
- ビルトイン (104)
-
json
/ add / exception (12)
キーワード
- == (12)
- backtrace (12)
-
backtrace
_ locations (12) - inspect (12)
-
set
_ backtrace (12) -
to
_ json (12) -
to
_ s (12)
検索結果
-
Exception
# to _ json(*args) -> String (9114.0) -
自身を JSON 形式の文字列に変換して返します。
...erator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\......",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
Exception
# to _ s -> String (9114.0) -
エラーメッセージをあらわす文字列を返します。
...エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}...