Class: Object

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

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



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

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

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



15
16
17
18
# File 'lib/rhino/java.rb', line 15

def tap
  yield self
  self
end