class Mittsu::HashArray

Public Class Methods

new() click to toggle source
# File lib/mittsu/core/hash_array.rb, line 5
def initialize()
  @array = []
  @hash = {}
end

Public Instance Methods

[](key) click to toggle source
# File lib/mittsu/core/hash_array.rb, line 10
def [](key)
  if key.is_a? Integer
    @array[key]
  else
    @hash[key]
  end
end
[]=(key, value) click to toggle source
# File lib/mittsu/core/hash_array.rb, line 18
def []=(key, value)
  if key.is_a? Integer
    @array[key] = value
  else
    @hash[key] = value
  end
end
count()
Alias for: length
each(&block) click to toggle source
# File lib/mittsu/core/hash_array.rb, line 26
def each(&block)
  @array.each(&block)
end
length() click to toggle source
# File lib/mittsu/core/hash_array.rb, line 30
def length
  @array.length
end
Also aliased as: count, size
size()
Alias for: length