class Rhino::Ruby::DefaultAccess

Public Instance Methods

get(object, name, scope) click to toggle source
Calls superclass method Rhino::Ruby::AccessBase#get
# File lib/rhino/ruby/default_access.rb, line 13
def get(object, name, scope)
  if object.respond_to?(name_s = name.to_s)
    method = object.method(name_s)
    if method.arity == 0
      return Rhino.to_javascript(method.call, scope)
    else
      return Function.wrap(method.unbind)
    end
  elsif object.respond_to?(:"#{name}=")
    return nil
  end
  super
end
has(object, name, scope) click to toggle source
Calls superclass method Rhino::Ruby::AccessBase#has
# File lib/rhino/ruby/default_access.rb, line 5
def has(object, name, scope)
  if object.respond_to?(name.to_s) || 
     object.respond_to?(:"#{name}=")
    return true
  end
  super
end
put(object, name, value) click to toggle source
Calls superclass method Rhino::Ruby::AccessBase#put
# File lib/rhino/ruby/default_access.rb, line 27
def put(object, name, value)
  if object.respond_to?(set_name = :"#{name}=")
    return object.send(set_name, Rhino.to_ruby(value))
  end
  super
end