Class: Liberty::Adapters::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/liberty/adapters/response.rb

Constant Summary collapse

CONTENT_TYPE =
"Content-Type"
CONTENT_LENGTH =
"Content-Length"
MIME_TYPE_JSON =
"application/json"
MIME_TYPE_HTML =
"text/html"
MIME_TYPE_TEXT =
"text/plain"
EMPTY_CONTENT =
""

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint) ⇒ Response

Returns a new instance of Response.



15
16
17
# File 'lib/liberty/adapters/response.rb', line 15

def initialize(endpoint)
  @endpoint = endpoint
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



13
14
15
# File 'lib/liberty/adapters/response.rb', line 13

def endpoint
  @endpoint
end

Instance Method Details

#to_rack_responseObject



19
20
21
# File 'lib/liberty/adapters/response.rb', line 19

def to_rack_response
  [status, headers, [content]]
end