Class: EmmyHttp::Response
- Inherits:
-
Object
- Object
- EmmyHttp::Response
- Includes:
- ModelPack::Document
- Defined in:
- lib/emmy_http/response.rb
Instance Method Summary collapse
-
#convert_headers(headers) ⇒ Object
CONTENT_TYPE becomes Content-Type.
- #to_a ⇒ Object
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_a ⇒ Object
9 10 11 |
# File 'lib/emmy_http/response.rb', line 9 def to_a [status, headers, body] end |