Class: ActionDispatch::Http::Headers

Inherits:
Hash show all
Extended by:
ActiveSupport::Memoizable
Defined in:
actionpack/lib/action_dispatch/http/headers.rb

Instance Method Summary collapse

Methods included from ActiveSupport::Memoizable

memoize, memoized_ivar_for

Methods inherited from Hash

#as_json, #assert_valid_keys, #deep_dup, #deep_merge, #deep_merge!, #diff, #encode_json, #except, #except!, #extract!, #extractable_options?, from_xml, #reverse_merge, #reverse_merge!, #slice, #slice!, #stringify_keys, #stringify_keys!, #symbolize_keys, #symbolize_keys!, #to_param, #to_xml, #with_indifferent_access

Constructor Details

#initialize(*args) ⇒ Headers

Returns a new instance of Headers.



8
9
10
11
12
13
14
15
# File 'actionpack/lib/action_dispatch/http/headers.rb', line 8

def initialize(*args)
  if args.size == 1 && args[0].is_a?(Hash)
    super()
    update(args[0])
  else
    super
  end
end

Instance Method Details

#[](header_name) ⇒ Object



17
18
19
20
21
22
23
# File 'actionpack/lib/action_dispatch/http/headers.rb', line 17

def [](header_name)
  if include?(header_name)
    super
  else
    super(env_name(header_name))
  end
end