Class: Lifer::Dev::Response
- Inherits:
-
Object
- Object
- Lifer::Dev::Response
- Defined in:
- lib/lifer/dev/response.rb
Overview
This class is responsible for building Rack-compatible responses for the ‘Lifer::Dev::Server`. This code would never be run in a production environment, where the Lifer builders are concerned.
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#build ⇒ Array
The Rack-compatible response.
-
#initialize(path) ⇒ void
constructor
Builds a single, Rack-compatible response object.
Constructor Details
#initialize(path) ⇒ void
Builds a single, Rack-compatible response object.
13 14 15 |
# File 'lib/lifer/dev/response.rb', line 13 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/lifer/dev/response.rb', line 7 def path @path end |
Instance Method Details
#build ⇒ Array
The Rack-compatible response. That’s an array with three items:
1. The HTTP status.
2. The HTTP headers.
3. The HTTP body response.
24 25 26 |
# File 'lib/lifer/dev/response.rb', line 24 def build [status, {"Content-Type": content_type}, contents] end |