るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. bodytypebasic param
  4. win32ole_param new
  5. win32ole_param name

ライブラリ

キーワード

検索結果

Exception#==(other) -> bool (20.0)

自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。

...返します。

@param other 自身と比較したいオブジェクトを指定します。
自身と異なるクラスのオブジェクトを指定した場合は
Exception
#exception を実行して変換を試みます。

//emlist[例][ruby]{
require
"date"
def check_...
...eturn if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end

def get_exception
return begin
yield
rescue => e
e
end
end

results = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, Runt...

Exception#to_json(*args) -> String (20.0)

自身を JSON 形式の文字列に変換して返します。

...JSON::Generator::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\":\"ZeroDivi...