com.tecnoguru.scuby

RubyObj

trait RubyObj extends AnyRef

A wrapped Ruby object. Adds convenience methods to call the JRuby methods.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RubyObj
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val obj: org.jruby.RubyObject

    The wrapped object

Concrete Value Members

  1. def !(name: Symbol, args: Any*): RubyObj

    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

    name

    The method name

    args

    The method parameters

    returns

    The wrapped return value of the method

    Exceptions thrown
    ClassCastException

    if the return value is not a RubyObj

    See also

    send

  2. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  3. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  4. def !?(name: Symbol, args: Any*): Option[RubyObj]

    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

    name

    The method name

    args

    The method parameters

    returns

    Same as sendOpt

    Exceptions thrown
    ClassCastException

    if the return value is not a RubyObj

    See also

    sendOpt

  5. final def ##(): Int

    Definition Classes
    AnyRef → Any
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. def apply(args: Any*): AnyRef

    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)

  9. def as[T](implicit tag: ClassTag[T]): T

    Wrap a RubyObj with a Scala interface

    Wrap a RubyObj with a Scala interface

    T

    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.

    returns

    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.

    See also

    http://stackoverflow.com/questions/11810414/generating-a-scala-class-automatically-from-a-trait

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def call(name: Symbol, args: Any*): Unit

    Call a method on the wrapped object ignoring its return type

    Call a method on the wrapped object ignoring its return type

    name

    The method name

    args

    The method parameters

    returns

    The wrapped return value of the method

    Exceptions thrown
    ClassCastException

    if the return value is not of the expected class

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(other: Any): Boolean

    Delegate equals to the Ruby object's ==

    Delegate equals to the Ruby object's ==

    Definition Classes
    RubyObj → AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    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.

    Definition Classes
    RubyObj → AnyRef → Any
  18. def isA_?(klazzName: Symbol): Boolean

    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?

    klazzName

    The name of the Ruby class

    returns

    true if the object is an instance of that class, false otherwise

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def respondTo_?(method: Symbol): Boolean

    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?

    method

    The name of the method

    returns

    true if the object implements the method, false otherwise

  24. def send[T](name: Symbol, args: Any*)(implicit tag: ClassTag[T]): T

    Call a method on the wrapped object indicating its return type

    Call a method on the wrapped object indicating its return type

    T

    The expected class of the return value

    name

    The method name

    args

    The method parameters

    returns

    The wrapped return value of the method

    Exceptions thrown
    ClassCastException

    if the return value is not of the expected class

  25. def sendOpt[T](name: Symbol, args: Any*)(implicit tag: ClassTag[T]): Option[Any]

    Convenience method.

    Convenience method. Call a method on the wrapped object indicating its return type, only if the object responds to that method

    T

    The expected class of the return value

    name

    The method name

    args

    The method parameters

    returns

    If the object doesn't respond to the method, return None. Otherwise, the wrapped return value of the method wrapped in a Some

    Exceptions thrown
    ClassCastException

    if the return value is not of the expected class

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Delegate toString to the Ruby object's to_s

    Delegate toString to the Ruby object's to_s

    Definition Classes
    RubyObj → AnyRef → Any
  28. def update[T](key: Any, value: T)(implicit tag: ClassTag[T]): Unit

    Convenient access to Array- or Hash-like Ruby objects

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped