Class: Object

Inherits:
BasicObject
Defined in:
lib/rhino/object.rb

Instance Method Summary collapse

Instance Method Details

#eval_js(source, options = {}) ⇒ Object


11
12
13
14
15
# File 'lib/rhino/object.rb', line 11

def eval_js(source, options = {})
  Rhino::Context.open(options.merge(:with => self)) do |cxt|
    cxt.eval(source)
  end
end

#tap {|_self| ... } ⇒ Object

:nodoc:

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on


5
6
7
8
# File 'lib/rhino/object.rb', line 5

def tap # :nodoc:
  yield self
  self
end