Class: MessageExchange::Response
- Inherits:
-
Object
- Object
- MessageExchange::Response
- Defined in:
- lib/message_exchange/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(api_response) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(api_response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/message_exchange/response.rb', line 5 def initialize(api_response) @api_response = api_response end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/message_exchange/response.rb', line 3 def body @body end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/message_exchange/response.rb', line 3 def status @status end |
Instance Method Details
#success? ⇒ Boolean
17 18 19 |
# File 'lib/message_exchange/response.rb', line 17 def success? (200..206).include?(status) end |