Auxiliary constructor for a new JRuby Object of a given class.
Auxiliary constructor for a new JRuby Object of a given class.
Name of the Ruby class to create the object
Any parameters to the constructor of the Ruby class
the object to wrap
Call a method on the wrapped object, expecting a RubyObj as a return value
Call a method on the wrapped object, expecting a RubyObj as a return value
The method name
The method parameters
The wrapped return value of the method
if the return value is not a RubyObj
send
Call a method on the wrapped object if it exists, expecting an Option[RubyObj] as a return value
Call a method on the wrapped object if it exists, expecting an Option[RubyObj] as a return value
The method name
The method parameters
Same as sendOpt
if the return value is not a RubyObj
sendOpt
Convenient access to Array- or Hash-like Ruby objects.
Convenient access to Array- or Hash-like Ruby objects. - If the object supports the "call" or "invoke" method (i.e. a block) it will call it with the given parameters - Otherwise, for one parameter will call the [] method on the object and return the result as an AnyRef - For more than one parameters, will call the [] method successively passing each subsequent parameter and return the result of the last call as an AnyRef (useful for Hashes of Hashes or Arrays of Arrays)
Wrap a RubyObj with a Scala interface
Wrap a RubyObj with a Scala interface
A trait that should declare (some) of the methods of the object. CamelCase -> snail_case conversion is done automatically, as well as assignmnent to attributes (x_= is converted to x=). Methods that are implemented in the trait are NOT forwarded.
A dynamically-generated proxy that forwards each method call to its corresponding Ruby call. Note that if the object doesn't actually implement the method, an exception is thrown at call time, not at wrapping time.
http://stackoverflow.com/questions/11810414/generating-a-scala-class-automatically-from-a-trait
Call a method on the wrapped object ignoring its return type
Call a method on the wrapped object ignoring its return type
The method name
The method parameters
The wrapped return value of the method
if the return value is not of the expected class
Delegate equals to the Ruby object's ==
Delegate equals to the Ruby object's ==
Delegate hashCode to the Ruby object's hash.
Delegate hashCode to the Ruby object's hash. Ruby's hash returns a Long while Java's hashCode returns an int.
Convenience method to see if an object belongs to a Ruby class.
Convenience method to see if an object belongs to a Ruby class. Wrapper around Object#is_a?
The name of the Ruby class
true if the object is an instance of that class, false otherwise
the object to wrap
the object to wrap
Convenience method to see if an object responds to a method.
Convenience method to see if an object responds to a method. Wrapper around Object#respond_to?
The name of the method
true if the object implements the method, false otherwise
Call a method on the wrapped object indicating its return type
Call a method on the wrapped object indicating its return type
The expected class of the return value
The method name
The method parameters
The wrapped return value of the method
if the return value is not of the expected class
Convenience method.
Convenience method. Call a method on the wrapped object indicating its return type, only if the object responds to that method
The expected class of the return value
The method name
The method parameters
If the object doesn't respond to the method, return None. Otherwise, the wrapped return value of the method wrapped in a Some
if the return value is not of the expected class
Delegate toString to the Ruby object's to_s
Delegate toString to the Ruby object's to_s
Convenient access to Array- or Hash-like Ruby objects
Convenient access to Array- or Hash-like Ruby objects
Wraps a JRuby object with our own convenience methods