fn can_access_rust_methods_from_ruby(ruby: &mut Ruby) {
    let mut player = Player::default();

    ruby.plug("player", &mut player);

    assert_eq!(Value::integer(player.x as _), ruby.eval("PLAYER.x").unwrap());
    assert_eq!(Value::integer(player.y as _), ruby.eval("PLAYER.y").unwrap());
    assert_eq!(Value::integer(player.z as _), ruby.eval("PLAYER.z").unwrap());
}
/// We should be able to call simple Rust methods from Ruby.
We should be able to call simple Rust methods from Ruby.
We should be able to call simple Rust methods from Ruby .
fn can_access_rust_methods_from_ruby(ruby: &mut Ruby) {
    let mut player = Player::default();
    ruby.plug("player", &mut player);
    assert_eq!(Value::integer(player.x as _), ruby.eval("PLAYER.x").unwrap());
    assert_eq!(Value::integer(player.y as _), ruby.eval("PLAYER.y").unwrap());
    assert_eq!(Value::integer(player.z as _), ruby.eval("PLAYER.z").unwrap());
}
fn can_access_rust_methods_from_ruby ( ruby : & mut Ruby ) { let mut player = Player :: default ( ) ; ruby . plug ( " " , & mut player ) ; assert_eq ! ( Value integer ( player x as ) ruby eval ( " " ) unwrap ( ) ) ; assert_eq ! ( Value integer ( player y as ) ruby eval ( " " ) unwrap ( ) ) ; assert_eq ! ( Value integer ( player z as ) ruby eval ( " " ) unwrap ( ) ) ; }
We should be able to call simple Rust methods from Ruby.
We should be able to call simple Rust methods from Ruby .
ruby
&mut Ruby
ruby
&mut Ruby