Class: EleetScript::ESProc
- Inherits:
-
Object
- Object
- EleetScript::ESProc
- Defined in:
- lib/engine/esproc.rb
Instance Attribute Summary collapse
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
- #call(receiver, args, context) ⇒ Object
-
#initialize(proc, engine) ⇒ ESProc
constructor
A new instance of ESProc.
Constructor Details
#initialize(proc, engine) ⇒ ESProc
Returns a new instance of ESProc.
5 6 7 8 |
# File 'lib/engine/esproc.rb', line 5 def initialize(proc, engine) @proc = proc @engine = engine end |
Instance Attribute Details
#proc ⇒ Object
Returns the value of attribute proc.
3 4 5 |
# File 'lib/engine/esproc.rb', line 3 def proc @proc end |
Instance Method Details
#call(receiver, args, context) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/engine/esproc.rb', line 10 def call(receiver, args, context) ruby_args = args.map do |arg| Values.to_ruby_value(arg, @engine) end Values.to_eleet_value(proc.call(*ruby_args), @engine) end |