Struct plugger_ruby::Value
[−]
[src]
pub struct Value(pub VALUE);
A Ruby value.
Methods
impl Value
[src]
fn nil() -> Value
[src]
Gets nil
.
fn boolean(b: bool) -> Value
[src]
Gets a boolean value.
fn boolean_true() -> Value
[src]
Gets the boolean true
value.
fn boolean_false() -> Value
[src]
Gets the boolean false
value.
fn symbol(name: &str) -> Value
[src]
Creates a new symbol.
fn string(s: &str) -> Value
[src]
Creates a new String.
fn integer(v: i64) -> Value
[src]
Creates a new Integer
.
fn float(v: f64) -> Value
[src]
Creates a new Float
.
fn to_sym(&self) -> Value
[src]
Converts the value into a symbol.
fn to_i64(&self) -> i64
[src]
Converts the value to a 64-bit signed integer.
fn to_u64(&self) -> u64
[src]
Converts the value to a 64-bit unsigned integer.
fn to_f64(&self) -> f64
[src]
Converts the value into a 64-bit float.
fn class(&self) -> Value
[src]
Gets the class.
fn nested_class<S>(self, name: S) -> Class where
S: Into<String>,
[src]
S: Into<String>,
Creates a nested class.
fn nested_module<S>(self, name: S) -> Module where
S: Into<String>,
[src]
S: Into<String>,
Creates a nested module.
fn display_string(&self) -> String
[src]
The value of Object#to_s
.
fn inspect_string(&self) -> String
[src]
The value of Object#inspect
.
fn class_name(&self) -> String
[src]
Gets the name of the class of the object.
fn is_nil(&self) -> bool
[src]
Checks if the value is nil
.
fn is_true(&self) -> bool
[src]
Checks if the value is true
.
fn is_false(&self) -> bool
[src]
Checks if the value is false.
fn is_string(&self) -> bool
[src]
Checks if the value is a String
type.
fn is_regex(&self) -> bool
[src]
Checks if the value is a regex.
fn is_integer(&self) -> bool
[src]
Checks if the value is an Integer
type.
fn is_complex_number(&self) -> bool
[src]
Checks if the value is a complex number.
fn is_rational(&self) -> bool
[src]
Checks if the value is a rational number.
fn is_symbol(&self) -> bool
[src]
Checks if the value is a symbol.
fn is_float(&self) -> bool
[src]
Checks if the value is a float.
fn is_array(&self) -> bool
[src]
Checks if the value is an array.
fn is_hash(&self) -> bool
[src]
Checks if the value is a hash.
fn is_object(&self) -> bool
[src]
Checks if the value is an object.
fn is_class(&self) -> bool
[src]
Checks if the value is a class.
fn is_struct(&self) -> bool
[src]
Checks if the value is a Struct
.
fn is_module(&self) -> bool
[src]
Checks if the value is a module.
fn is_equal_to(&self, other: Value) -> Value
[src]
Ruby's version of '=='
fn as_string(&self) -> Option<String>
[src]
Converts a Ruby String
into a Rust String
.
Returns None
if the value is not a Ruby String
.
fn call_no_args(&self, method_name: &str) -> Value
[src]
Calls a method with no args.
fn send(&self, method_name: &str, args: &[Value]) -> Value
[src]
Sends a message to the value.
fn get_ivar(&self, name: &str) -> Value
[src]
Gets the value of an instance variable by name.
Returns nil
if it doesn't exist.
fn set_ivar(&self, name: &str, value: Value) -> Value
[src]
Sets the value of an instance variable (or creates a new one).
Trait Implementations
impl Copy for Value
[src]
impl Clone for Value
[src]
impl Eq for Value
[src]
impl From<VALUE> for Value
[src]
impl PartialEq<Value> for Value
[src]
impl Debug for Value
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.