Module: EmmyHttp::Utils
Instance Method Summary collapse
-
#convert_headers(headers) ⇒ Object
CONTENT_TYPE becomes Content-Type.
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 |