Class: Payoneer::Response
- Inherits:
-
Object
- Object
- Payoneer::Response
- Defined in:
- lib/payoneer/response.rb
Constant Summary collapse
- OK_STATUS_CODE =
'000'
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(code, body) ⇒ Response
constructor
A new instance of Response.
- #ok? ⇒ Boolean
Constructor Details
#initialize(code, body) ⇒ Response
Returns a new instance of Response.
11 12 13 14 |
# File 'lib/payoneer/response.rb', line 11 def initialize(code, body) @code = code @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/payoneer/response.rb', line 3 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/payoneer/response.rb', line 3 def code @code end |
Class Method Details
.new_ok_response(body) ⇒ Object
7 8 9 |
# File 'lib/payoneer/response.rb', line 7 def self.new_ok_response(body) new(OK_STATUS_CODE, body) end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 |
# File 'lib/payoneer/response.rb', line 20 def ==(other) code == other.code && body == other.body end |
#ok? ⇒ Boolean
16 17 18 |
# File 'lib/payoneer/response.rb', line 16 def ok? code == OK_STATUS_CODE end |