class Excon::Headers

Constants

SENTINEL

Public Class Methods

new() click to toggle source
# File lib/excon/headers.rb, line 23
def initialize
  @downcased = {}
end

Public Instance Methods

[](key) click to toggle source
# File lib/excon/headers.rb, line 27
def [](key)
  @downcased[key.to_s.downcase]
end
Also aliased as: raw_reader
[]=(key, value) click to toggle source
# File lib/excon/headers.rb, line 32
def []=(key, value)
  raw_writer(key, value)
  @downcased[key.to_s.downcase] = value
end
Also aliased as: raw_writer
assoc(obj) click to toggle source
# File lib/excon/headers.rb, line 38
def assoc(obj)
  @downcased.assoc(obj.downcase)
end
delete(key, &proc) click to toggle source
# File lib/excon/headers.rb, line 43
def delete(key, &proc)
  raw_delete(key, &proc)
  @downcased.delete(key.to_s.downcase, &proc)
end
Also aliased as: raw_delete
fetch(key, default = nil, &proc) click to toggle source
# File lib/excon/headers.rb, line 48
def fetch(key, default = nil, &proc)
  if proc
    @downcased.fetch(key.to_s.downcase, &proc)
  else
    @downcased.fetch(key.to_s.downcase, default)
  end
end
Also aliased as: raw_fetch
has_key?(key) click to toggle source
# File lib/excon/headers.rb, line 58
def has_key?(key)
  raw_key?(key) || @downcased.has_key?(key.to_s.downcase)
end
Also aliased as: raw_has_key?
merge(other_hash) click to toggle source
# File lib/excon/headers.rb, line 62
def merge(other_hash)
  self.dup.merge!(other_hash)
end
Also aliased as: raw_merge
merge!(other_hash) click to toggle source
# File lib/excon/headers.rb, line 66
def merge!(other_hash)
  other_hash.each do |key, value|
    self[key] = value
  end
  raw_merge!(other_hash)
end
Also aliased as: raw_merge!
raw_delete(key, &proc)
Alias for: delete
raw_fetch(key, default = nil, &proc)
Alias for: fetch
raw_has_key?(key)
Alias for: has_key?
raw_merge(other_hash)
Alias for: merge
raw_merge!(other_hash)
Alias for: merge!
raw_reader(key)
Alias for: []
raw_rehash()
Alias for: rehash
raw_values_at(*keys)
Alias for: values_at
raw_writer(key, value)
Alias for: []=
rehash() click to toggle source
# File lib/excon/headers.rb, line 73
def rehash
  @downcased.rehash
  raw_rehash
end
Also aliased as: raw_rehash
values_at(*keys) click to toggle source
# File lib/excon/headers.rb, line 78
def values_at(*keys)
  @downcased.values_at(*keys.map {|key| key.to_s.downcase})
end
Also aliased as: raw_values_at