APIdock / Ruby
/
method

exception

ruby latest stable - Class: Exception
exception(*args)
public

With no argument, or if the argument is the same as the receiver, return the receiver. Otherwise, create a new exception object of the same class as the receiver, but with a message equal to string.to_str.

static VALUE
exc_exception(int argc, VALUE *argv, VALUE self)
{
 VALUE exc;
 if (argc == 0) return self;
 if (argc == 1 && self == argv[0]) return self;
 exc = rb_obj_clone(self);
 exc_initialize(argc, argv, exc);
 return exc;
}

AltStyle によって変換されたページ (->オリジナル) /