Class: Bcash::Api::Response
- Inherits:
-
Object
- Object
- Bcash::Api::Response
- Defined in:
- lib/bcash/api/response.rb
Direct Known Subclasses
AccountNotValidResponse, AccountResponse, TransactionResponse, VerifyReturnResponse
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#http_code ⇒ Object
Returns the value of attribute http_code.
-
#message ⇒ Object
Returns the value of attribute message.
-
#success ⇒ Object
Returns the value of attribute success.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #messages ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 8 9 |
# File 'lib/bcash/api/response.rb', line 5 def initialize(response) self.success = false @http_code = response.code parse_body(response) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/bcash/api/response.rb', line 3 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/bcash/api/response.rb', line 3 def code @code end |
#http_code ⇒ Object
Returns the value of attribute http_code.
3 4 5 |
# File 'lib/bcash/api/response.rb', line 3 def http_code @http_code end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/bcash/api/response.rb', line 3 def @message end |
#success ⇒ Object
Returns the value of attribute success.
3 4 5 |
# File 'lib/bcash/api/response.rb', line 3 def success @success end |
Instance Method Details
#errors ⇒ Object
19 20 21 |
# File 'lib/bcash/api/response.rb', line 19 def errors body['list'] end |
#messages ⇒ Object
27 28 29 |
# File 'lib/bcash/api/response.rb', line 27 def end |
#success? ⇒ Boolean
23 24 25 |
# File 'lib/bcash/api/response.rb', line 23 def success? success end |