Sha256: fa2596b2e6fb8aa1eba8d526135bf1aed24106ddb5b79ee9c2a3eaf440e3ffd6
Contents?: true
Size: 541 Bytes
Versions: 11
Compression:
Stored size: 541 Bytes
Contents
module Mittsu class HashArray include Enumerable def initialize() @array = [] @hash = {} end def [](key) if key.is_a? Fixnum @array[key] else @hash[key] end end def []=(key, value) if key.is_a? Fixnum @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
11 entries across 11 versions & 1 rubygems