1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use crate::load::MrbLoadSources; use crate::Mrb; use crate::MrbError; pub fn init(interp: &Mrb) -> Result<(), MrbError> { interp .borrow_mut() .def_class::<Delegator>("Delegator", None, None); interp .borrow_mut() .def_class::<SimpleDelegator>("SimpleDelegator", None, None); interp.def_rb_source_file("delegate.rb", include_str!("delegate.rb"))?; Ok(()) } pub struct Delegator; pub struct SimpleDelegator;