Struct ruru::Fixnum [] [src]

pub struct Fixnum {
    // some fields omitted
}

Fixnum

Methods

impl Fixnum
[src]

fn new(num: i64) -> Self

Creates a new Fixnum.

Examples

use ruru::{Fixnum, VM};

let fixnum = Fixnum::new(1);

assert_eq!(fixnum.to_i64(), 1);

Ruby:

1 == 1

fn to_i64(&self) -> i64

Retrieves an i64 value from Fixnum.

Examples

use ruru::{Fixnum, VM};

let fixnum = Fixnum::new(1);

assert_eq!(fixnum.to_i64(), 1);

Ruby:

1 == 1

Trait Implementations

impl PartialEq for Fixnum
[src]

fn eq(&self, __arg_0: &Fixnum) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Fixnum) -> bool

This method tests for !=.

impl Debug for Fixnum
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl From<Value> for Fixnum
[src]

fn from(value: Value) -> Self

Performs the conversion.

impl Object for Fixnum
[src]

fn value(&self) -> Value

Usually this function just returns a value of current object. Read more

fn class(&self) -> Class

Returns a Class struct of current object Read more

fn send(&self, method: &str, arguments: Vec<AnyObject>) -> AnyObject

Calls a given method on an object similarly to Ruby Object#send method Read more

fn as_any_object(&self) -> AnyObject

Converts struct to AnyObject Read more

fn instance_variable_get(&self, variable: &str) -> AnyObject

Sets an instance variable for object Read more

fn instance_variable_set<T: Object>(&mut self, variable: &str, value: T) -> AnyObject

Gets an instance variable of object Read more