Class: Dolphy::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status = 200, headers = {"Content-type" => "text/html"}) ⇒ Response



5
6
7
8
9
10
# File 'lib/dolphy/response.rb', line 5

def initialize(status = 200,
               headers = {"Content-type" => "text/html"})
  @status  = status
  @headers = headers
  @body    = []
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/dolphy/response.rb', line 3

def body
  @body
end

#headersObject

Returns the value of attribute headers.



3
4
5
# File 'lib/dolphy/response.rb', line 3

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/dolphy/response.rb', line 3

def status
  @status
end

Instance Method Details

#finishObject



12
13
14
# File 'lib/dolphy/response.rb', line 12

def finish
  [status, headers, body]
end