Class: Rubai::RackResponse
- Inherits:
-
Object
- Object
- Rubai::RackResponse
- Defined in:
- lib/rubai/rack_response.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(response = nil) ⇒ RackResponse
constructor
A new instance of RackResponse.
- #respond_with(response) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response = nil) ⇒ RackResponse
Returns a new instance of RackResponse.
3 4 5 |
# File 'lib/rubai/rack_response.rb', line 3 def initialize(response=nil) @response = response end |
Instance Method Details
#call ⇒ Object
12 13 14 |
# File 'lib/rubai/rack_response.rb', line 12 def call [response.status, response.headers, response.body] end |
#respond_with(response) ⇒ Object
7 8 9 10 |
# File 'lib/rubai/rack_response.rb', line 7 def respond_with(response) @response = response call end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/rubai/rack_response.rb', line 16 def to_s "#{response.status}, #{response.headers}, #{response.body.join}" end |