fn exception(&self, string: Option<&str>) -> Self {
        let string = string.map(|s| RString::new_utf8(s).value());

        Self::from(vm::call_method(self.value(), "exception", util::option_to_slice(&string)))
    }
/// 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`.
///
/// # Examples
/// ```
/// use rutie::{AnyException, Exception, Object, VM};
/// # VM::init();
///
/// assert_eq!(
///   AnyException::new("StandardError", Some("something went wrong")).exception(None),
///   AnyException::new("StandardError", Some("something went wrong"))
/// );
/// ```
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`.
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 ` .
fn exception(&self, string: Option<&str>) -> Self {
        let string = string.map(|s| RString::new_utf8(s).value());
        Self::from(vm::call_method(self.value(), "exception", util::option_to_slice(&string)))
    }
fn exception ( & self , string : Option < & str > ) -> Self { let string = string . map ( | s | RString :: new_utf8 ( s ) . value ( ) ) ; Self :: from ( vm :: call_method ( self . value ( ) , " " , util :: option_to_slice ( & string ) ) ) }
With no argument, or if the argument is the same as the receiver,
return the receiver.
With no argument or if the argument is the same as the receiver return the receiver .
&self
string
Option<&str>
&self
string
Option<&str>
examples
```
use rutie::{AnyException, Exception, Object, VM}.
` ` ` use rutie :: { AnyException Exception Object VM } .
vm::init();
assert_eq!(
AnyException::new("StandardError", Some("something went wrong")).exception(None),
AnyException::new("StandardError", Some("something went wrong"))
);
```
assert_eq! ( AnyException :: new ( " StandardError " Some ( " something went wrong " )) . exception ( None ) AnyException :: new ( " StandardError " Some ( " something went wrong " )) ) ; ` ` `