class EleetScript::EleetScriptArray

Attributes

array[R]
hash[R]

Public Class Methods

new(memory, super_class = nil) click to toggle source
Calls superclass method
# File lib/lang/runtime/array.rb, line 5
def initialize(memory, super_class = nil)
  super(memory, super_class)
  @hash = {}
  @array = []
end

Public Instance Methods

to_s() click to toggle source
# File lib/lang/runtime/array.rb, line 11
def to_s
  str = "<EleetScriptArray"
  hash_data = @hash.map do |key, value|
    "#{key}=#{value}"
  end
  data = @array.dup.concat(hash_data)
  if data.length > 0
    str += "[" + data.join(", ") + "]"
  end
  str + ">"
end