Class: Rubai::RackResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/rubai/rack_response.rb

Instance Method Summary collapse

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

#callObject



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_sObject



16
17
18
# File 'lib/rubai/rack_response.rb', line 16

def to_s
  "#{response.status}, #{response.headers}, #{response.body.join}"
end