Class: OnlinePayments::SDK::Domain::PaymentsReportResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentsReportResponse
- Defined in:
- lib/onlinepayments/sdk/domain/payments_report_response.rb
Instance Attribute Summary collapse
-
#pagination ⇒ OnlinePayments::SDK::Domain::CursorPaginationInfo
The current value of pagination.
-
#payments ⇒ Array<OnlinePayments::SDK::Domain::PaymentSummary>
The current value of payments.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#pagination ⇒ OnlinePayments::SDK::Domain::CursorPaginationInfo
Returns the current value of pagination.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/payments_report_response.rb', line 13 def pagination @pagination end |
#payments ⇒ Array<OnlinePayments::SDK::Domain::PaymentSummary>
Returns the current value of payments.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/payments_report_response.rb', line 13 def payments @payments end |
Instance Method Details
#from_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/onlinepayments/sdk/domain/payments_report_response.rb', line 27 def from_hash(hash) super if hash.has_key? 'pagination' raise TypeError, "value '%s' is not a Hash" % [hash['pagination']] unless hash['pagination'].is_a? Hash @pagination = OnlinePayments::SDK::Domain::CursorPaginationInfo.new_from_hash(hash['pagination']) end if hash.has_key? 'payments' raise TypeError, "value '%s' is not an Array" % [hash['payments']] unless hash['payments'].is_a? Array @payments = [] hash['payments'].each do |e| @payments << OnlinePayments::SDK::Domain::PaymentSummary.new_from_hash(e) end end end |
#to_h ⇒ Hash
20 21 22 23 24 25 |
# File 'lib/onlinepayments/sdk/domain/payments_report_response.rb', line 20 def to_h hash = super hash['pagination'] = @pagination.to_h unless @pagination.nil? hash['payments'] = @payments.collect{|val| val.to_h} unless @payments.nil? hash end |