- 
                Notifications
    
You must be signed in to change notification settings  - Fork 37
 
Upgrading from 0.7 to 0.8
- 
Change
use ruru::traits::Objecttouse ruru::Object. - 
Some general methods were moved to
Objecttrait, so importruru::Objectwhen using: 
AnyObject::to()AnyObject::ty()Class::define()Class::define_method()Class::define_singleton_method()
- 
Object::to()(AnyObject::to()in 0.7.x) was marked as unsafe. 
object.to::<Array>();becomes
unsafe { object.to::<Array>() };- 
methods!macro: 
- 
If you are sure that arguments that are received from Ruby always have correct types, change
methods!macro tounsafe_methods!. No more changes required. - 
Otherwise to safely convert objects, method arguments will have
Result<T: Object, Error>type.For example if your method signature looks like
fn some_method(array: Array) -> NilClass {}
arrayvariable will have typearray: Result<Array, Error>See documentation for
methods!for more examples. 
- 
Class::new()receives optional superclass, so addNoneas second argument for compatibilityClass::new("SomeClass", None);
 - 
Hash::eachwas changed to yield keys and values only asAnyObjects.You should remove types from closure arguments and use safe/unsafe conversions to convert
AnyObjects to the type which is needed.