Class: Rhino::RubyFunction
- Defined in:
- lib/rhino/ruby_function.rb
Instance Method Summary collapse
- #call(cxt, scope, this, args) ⇒ Object
-
#initialize(callable) ⇒ RubyFunction
constructor
A new instance of RubyFunction.
Constructor Details
#initialize(callable) ⇒ RubyFunction
Returns a new instance of RubyFunction.
5 6 7 8 |
# File 'lib/rhino/ruby_function.rb', line 5 def initialize(callable) super() @callable = callable end |
Instance Method Details
#call(cxt, scope, this, args) ⇒ Object
10 11 12 |
# File 'lib/rhino/ruby_function.rb', line 10 def call(cxt, scope, this, args) To.javascript @callable.call(*args.map {|a| To.ruby(a)}) end |