A case-insensitive Hash that preserves the original case of a header when set.

Methods
#
D
E
H
I
K
M
N
R
T
Class Public methods
new(hash={})
# File lib/rack/utils.rb, line 439
def initialize(hash={})
  super()
  @names = {}
  hash.each { |k, v| self[k] = v }
end
new(hash={})
# File lib/rack/utils.rb, line 435
def self.new(hash={})
  HeaderHash === hash ? hash : super(hash)
end
Instance Public methods
[](k)
# File lib/rack/utils.rb, line 463
def [](k)
  super(k) || super(@names[k.downcase])
end
[]=(k, v)
# File lib/rack/utils.rb, line 467
def []=(k, v)
  canonical = k.downcase.freeze
  delete k if @names[canonical] && @names[canonical] != k # .delete is expensive, don't invoke it unless necessary
  @names[canonical] = k
  super k, v
end
delete(k)
# File lib/rack/utils.rb, line 474
def delete(k)
  canonical = k.downcase
  result = super @names.delete(canonical)
  result
end
each()
# File lib/rack/utils.rb, line 451
def each
  super do |k, v|
    yield(k, v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v)
  end
end
has_key?(k)
Alias for: include?
include?(k)
Also aliased as: has_key?, member?, key?
# File lib/rack/utils.rb, line 480
def include?(k)
  super || @names.include?(k.downcase)
end
initialize_copy(other)

on dup/clone, we need to duplicate @names hash

# File lib/rack/utils.rb, line 446
def initialize_copy(other)
  super
  @names = other.names.dup
end
key?(k)
Alias for: include?
member?(k)
Alias for: include?
merge(other)
# File lib/rack/utils.rb, line 493
def merge(other)
  hash = dup
  hash.merge! other
end
merge!(other)
# File lib/rack/utils.rb, line 488
def merge!(other)
  other.each { |k, v| self[k] = v }
  self
end
replace(other)
# File lib/rack/utils.rb, line 498
def replace(other)
  clear
  other.each { |k, v| self[k] = v }
  self
end
to_hash()
# File lib/rack/utils.rb, line 457
def to_hash
  hash = {}
  each { |k,v| hash[k] = v }
  hash
end
Instance Protected methods
names()
# File lib/rack/utils.rb, line 505
def names
  @names
end