Class: EmmyHttp::Response

Inherits:
Object
  • Object
show all
Includes:
ModelPack::Document
Defined in:
lib/emmy_http/response.rb

Instance Method Summary collapse

Instance Method Details

#convert_headers(headers) ⇒ Object

CONTENT_TYPE becomes Content-Type



14
15
16
17
18
19
20
21
22
# File 'lib/emmy_http/response.rb', line 14

def convert_headers(headers)
  {}.tap do |result|
    headers.each do |k, v|
      words = k.split("_")
      key = words.map { |w| w.downcase.capitalize }.join("-")
      result[key] = v
    end
  end
end

#to_aObject



9
10
11
# File 'lib/emmy_http/response.rb', line 9

def to_a
  [status, headers, body]
end