class Temple::ImmutableHash

@api public
Immutable hash class which supports hash merging

def [](key)

def [](key)
  @hash.each {|h| return h[key] if h.include?(key) }
  nil
end

def each

def each
  keys.each {|k| yield(k, self[k]) }
end

def include?(key)

def include?(key)
  @hash.any? {|h| h.include?(key) }
end

def initialize(*hash)

def initialize(*hash)
  @hash = hash.compact
end

def keys

def keys
  @hash.inject([]) {|keys, h| keys.concat(h.keys) }.uniq
end

def to_hash

def to_hash
  result = {}
  each {|k, v| result[k] = v }
  result
end

def values

def values
  keys.map {|k| self[k] }
end