Class: Cequens::Response
- Inherits:
-
Object
- Object
- Cequens::Response
- Defined in:
- lib/cequens/response.rb
Instance Attribute Summary collapse
-
#api_response ⇒ Object
readonly
Returns the value of attribute api_response.
Instance Method Summary collapse
- #api_response_body ⇒ Object
- #failure? ⇒ Boolean
-
#initialize(api_response) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(api_response) ⇒ Response
Returns a new instance of Response.
7 8 9 |
# File 'lib/cequens/response.rb', line 7 def initialize(api_response) @api_response = api_response end |
Instance Attribute Details
#api_response ⇒ Object (readonly)
Returns the value of attribute api_response.
5 6 7 |
# File 'lib/cequens/response.rb', line 5 def api_response @api_response end |
Instance Method Details
#api_response_body ⇒ Object
19 20 21 |
# File 'lib/cequens/response.rb', line 19 def api_response_body api_response end |
#failure? ⇒ Boolean
15 16 17 |
# File 'lib/cequens/response.rb', line 15 def failure? !success? end |
#message ⇒ Object
23 24 25 |
# File 'lib/cequens/response.rb', line 23 def api_response_body['replyMessage'] end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/cequens/response.rb', line 11 def success? api_response_body['replyCode'].zero? end |