Sha256: 58ebe86e9231fb2c20257b71e570de1e87425c2136788b614b72bca002541c5e

Contents?: true

Size: 796 Bytes

Versions: 8

Compression:

Stored size: 796 Bytes

Contents

use ruru::{
  RString,
  AnyObject,
  Object,
};

#[derive(Debug)]
pub struct RubyDebugInfo {
  object_id: String,
  class: String,
  inspect: String,
}

impl From<AnyObject> for RubyDebugInfo {
  fn from(ao: AnyObject) -> Self {
    let object_id = ao.send("object_id", None).send("to_s", None).
      try_convert_to::<RString>().unwrap_or(RString::new("Failed to get object_id!")).to_string();
    let class = ao.send("class", None).send("to_s", None).
      try_convert_to::<RString>().unwrap_or(RString::new("Failed to get class!")).to_string();
    let inspect = ao.send("inspect", None).
      try_convert_to::<RString>().unwrap_or(RString::new("Failed to get inspect!")).to_string();

    RubyDebugInfo {
      object_id: object_id,
      class: class,
      inspect: inspect,
    }
  }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
faster_path-0.3.10 src/debug.rs
faster_path-0.3.9 src/debug.rs
faster_path-0.3.8 src/debug.rs
faster_path-0.3.7 src/debug.rs
faster_path-0.3.6 src/debug.rs
faster_path-0.3.2 src/debug.rs
faster_path-0.3.1 src/debug.rs
faster_path-0.2.6 src/debug.rs