Sha256: b7dbc7d8a12e75a0559be9b865e4e26525cafcec3e64a0ecba7f7c74668adc8e
Contents?: true
Size: 543 Bytes
Versions: 9
Compression:
Stored size: 543 Bytes
Contents
module Mittsu class HashArray include Enumerable def initialize() @array = [] @hash = {} end def [](key) if key.is_a? Integer @array[key] else @hash[key] end end def []=(key, value) if key.is_a? Integer @array[key] = value else @hash[key] = value end end def each(&block) @array.each(&block) end def length @array.length end alias_method :count, :length alias_method :size, :length end end
Version data entries
9 entries across 9 versions & 1 rubygems