Class: Payoneer::Response
- Inherits:
-
Object
- Object
- Payoneer::Response
- Defined in:
- lib/payoneer/responses/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response = {}) ⇒ Response
Returns a new instance of Response.
18 19 20 21 22 23 |
# File 'lib/payoneer/responses/response.rb', line 18 def initialize(response = {}) @body = {}.with_indifferent_access add_methods(response.keys) update_attributes(response) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/payoneer/responses/response.rb', line 3 def body @body end |
Class Method Details
.convert(response) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/payoneer/responses/response.rb', line 7 def self.convert(response) case response when Array response.map { |i| convert(i) } when Hash new(response) else response end end |