Method: M2R::Headers#initialize

Defined in:
lib/m2r/headers.rb

#initialize(hash = {}, compatible = false) ⇒ Headers

Returns a new instance of Headers.



13
14
15
16
17
18
19
# File 'lib/m2r/headers.rb', line 13

def initialize(hash = {}, compatible = false)
  @headers = hash and return if compatible
  @headers = hash.inject({}) do |headers,(header,value)|
    headers[transform_key(header)] = value
    headers
  end
end