class Rhino::Ruby::Object

Constants

TYPE

Public Class Methods

new(object, scope) click to toggle source
Calls superclass method
# File lib/rhino/ruby.rb, line 102
def initialize(object, scope)
  super()
  @ruby = object
  JS::ScriptRuntime.setBuiltinProtoAndParent(self, scope, TYPE) if scope
end
wrap(object, scope = nil) click to toggle source

wrap an arbitrary (ruby) object

# File lib/rhino/ruby.rb, line 96
def self.wrap(object, scope = nil)
  Ruby.cache(object) { new(object, scope) }
end

Public Instance Methods

'=='(other)
Alias for: equivalentValues
equivalentValues(other) click to toggle source

protected Object ScriptableObject#equivalentValues(Object value)

# File lib/rhino/ruby.rb, line 123
def equivalentValues(other) # JS == operator
  other.is_a?(Object) && unwrap.eql?(other.unwrap)
end
Also aliased as: '=='
getClassName() click to toggle source

abstract String Scriptable#getClassName();

# File lib/rhino/ruby.rb, line 114
def getClassName
  @ruby.class.to_s # to_s handles 'nameless' classes as well
end
toString() click to toggle source
# File lib/rhino/ruby.rb, line 118
def toString
  "[ruby #{getClassName}]" # [object User]
end
unwrap() click to toggle source

abstract Object Wrapper#unwrap();

# File lib/rhino/ruby.rb, line 109
def unwrap
  @ruby
end