Class: PayoneerApiClient::Response
- Inherits:
-
Object
- Object
- PayoneerApiClient::Response
- Defined in:
- lib/payoneer_api_client/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#other ⇒ Object
readonly
Returns the value of attribute other.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(res) ⇒ Response
constructor
A new instance of Response.
- #ok? ⇒ Boolean
Constructor Details
#initialize(res) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 11 |
# File 'lib/payoneer_api_client/response.rb', line 6 def initialize(res) @code = res[RESP_FIELD[:code]] @description = res[RESP_FIELD[:desc]] @other = res.delete_if { |v| RESP_FIELD.values.include?(v) } errors unless @code.zero? end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/payoneer_api_client/response.rb', line 4 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/payoneer_api_client/response.rb', line 4 def description @description end |
#other ⇒ Object (readonly)
Returns the value of attribute other.
4 5 6 |
# File 'lib/payoneer_api_client/response.rb', line 4 def other @other end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/payoneer_api_client/response.rb', line 17 def ==(other) code == other.code && description == other.description end |
#ok? ⇒ Boolean
13 14 15 |
# File 'lib/payoneer_api_client/response.rb', line 13 def ok? code.zero? end |