Sha256: fe86eb8b4ed111359c56c1606cd034dfb63d4786c4e866d388a60ce7083aefc0
Contents?: true
Size: 700 Bytes
Versions: 52
Compression:
Stored size: 700 Bytes
Contents
require 'volt' module Volt # Wrapper around a Hash for easy http header creation / manipulation with # indifferent access. # header[:content_type] == header['Content-Type'] == # header['content-type'] == header ['Content_Type'] class HttpResponseHeader < Hash def []=(key, value) super(key.to_s.headerize, value) end def [](key) super(key.to_s.headerize) end def delete(key) super(key.to_s.headerize) end def merge(other) dup.merge!(other) end def merge!(other) new_hash = {} other.each_with_object(new_hash) do |(key, value), hash| self[key.to_s.headerize] = value end self end end end
Version data entries
52 entries across 52 versions & 1 rubygems