class Basic101::FunctionCall

Public Class Methods

new(identifier, arguments) click to toggle source
# File lib/basic101/function_call.rb, line 9
def initialize(identifier, arguments)
  @identifier = identifier
  @arguments = arguments
end

Public Instance Methods

eval(runtime) click to toggle source
# File lib/basic101/function_call.rb, line 14
def eval(runtime)
  runtime.call_function(@identifier, argument_values(runtime))
end

Protected Instance Methods

state() click to toggle source
# File lib/basic101/function_call.rb, line 20
def state
  [@identifier, @arguments]
end

Private Instance Methods

argument_values(runtime) click to toggle source
# File lib/basic101/function_call.rb, line 26
def argument_values(runtime)
  @arguments.map do |argument|
    argument.eval(runtime)
  end
end