Class: Blix::Rest::Response
- Inherits:
-
Object
- Object
- Blix::Rest::Response
- Defined in:
- lib/blix/rest/response.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize ⇒ Response
constructor
A new instance of Response.
- #set(status, content = nil, headers = nil) ⇒ Object
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 |
# File 'lib/blix/rest/response.rb', line 13 def initialize @status = 200 @headers = Rack::Headers.new @content = nil end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
11 12 13 |
# File 'lib/blix/rest/response.rb', line 11 def content @content end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/blix/rest/response.rb', line 10 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/blix/rest/response.rb', line 9 def status @status end |
Instance Method Details
#set(status, content = nil, headers = nil) ⇒ Object
19 20 21 22 23 |
# File 'lib/blix/rest/response.rb', line 19 def set(status,content=nil,headers=nil) @status = status if status @content = [String.new(content)] if content @headers.merge!(headers) if headers end |