Class: Halchemy::HttpModel::Response
- Inherits:
-
Object
- Object
- Halchemy::HttpModel::Response
- Defined in:
- lib/halchemy/http_model.rb
Overview
Provides HTTP metadata that came along with the response resulting in the Resource this is attached to
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#error ⇒ Object
Returns the value of attribute error.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, reason, headers, body = nil) ⇒ Response
constructor
A new instance of Response.
- #to_s ⇒ Object
Constructor Details
#initialize(status_code, reason, headers, body = nil) ⇒ Response
Returns a new instance of Response.
29 30 31 32 33 34 |
# File 'lib/halchemy/http_model.rb', line 29 def initialize(status_code, reason, headers, body = nil) @status_code = status_code @reason = reason @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
27 28 29 |
# File 'lib/halchemy/http_model.rb', line 27 def body @body end |
#error ⇒ Object
Returns the value of attribute error.
27 28 29 |
# File 'lib/halchemy/http_model.rb', line 27 def error @error end |
#headers ⇒ Object
Returns the value of attribute headers.
27 28 29 |
# File 'lib/halchemy/http_model.rb', line 27 def headers @headers end |
#reason ⇒ Object
Returns the value of attribute reason.
27 28 29 |
# File 'lib/halchemy/http_model.rb', line 27 def reason @reason end |
#status_code ⇒ Object
Returns the value of attribute status_code.
27 28 29 |
# File 'lib/halchemy/http_model.rb', line 27 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
36 37 38 |
# File 'lib/halchemy/http_model.rb', line 36 def to_s "#{@status_code} #{@reason}" end |