Sha256: 5caeafecef7511f824ad042f3045224fd6bc039b1ab8654bffa9046275a24cbd

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 Bytes

Contents

module Basic101

  class FunctionCall

    include Identity

    def initialize(identifier, arguments)
      @identifier = identifier
      @arguments = arguments
    end

    def eval(runtime)
      runtime.call_function(@identifier, argument_values(runtime))
    end

    protected

    def state
      [@identifier, @arguments]
    end

    private

    def argument_values(runtime)
      @arguments.map do |argument|
        argument.eval(runtime)
      end
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-0.4.0 lib/basic101/function_call.rb
basic101-0.2.0 lib/basic101/function_call.rb
basic101-0.1.0 lib/basic101/function_call.rb