class EleetScript::ESProc

Attributes

proc[RW]

Public Class Methods

new(proc, engine) click to toggle source
# File lib/engine/esproc.rb, line 5
def initialize(proc, engine)
  @proc = proc
  @engine = engine
end

Public Instance Methods

call(receiver, args, context) click to toggle source
# 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