Module: EmmyHttp::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/emmy_http/utils.rb

Instance Method Summary collapse

Instance Method Details

#convert_headers(headers) ⇒ Object

CONTENT_TYPE becomes Content-Type



6
7
8
9
10
# File 'lib/emmy_http/utils.rb', line 6

def convert_headers(headers)
  headers.inject({}) { |h, (k, v)|
    h[k.split(/[_-]/).map { |w| w.downcase.capitalize }.join('-')] = v; h
  }
end