Class: Unit::Payment::ListPaymentParams
- Inherits:
-
Object
- Object
- Unit::Payment::ListPaymentParams
- Defined in:
- lib/unit/models/payment/list_payment_params.rb
Instance Attribute Summary collapse
-
#_until ⇒ Object
readonly
Returns the value of attribute _until.
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#counterparty_account_id ⇒ Object
readonly
Returns the value of attribute counterparty_account_id.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#from_amount ⇒ Object
readonly
Returns the value of attribute from_amount.
-
#include ⇒ Object
readonly
Returns the value of attribute include.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#recurring_payment_id ⇒ Object
readonly
Returns the value of attribute recurring_payment_id.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#to_amount ⇒ Object
readonly
Returns the value of attribute to_amount.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(limit = PAYMENT_LIMIT, offset = PAYMENT_OFFSET, account_id = nil, customer_id = nil, counterparty_account_id = nil, tags = nil, status = nil, type = nil, direction = nil, since = nil, _until = nil, from_amount = nil, to_amount = nil, recurring_payment_id = nil, feature = nil, sort = nil, include = nil) ⇒ ListPaymentParams
constructor
A new instance of ListPaymentParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = PAYMENT_LIMIT, offset = PAYMENT_OFFSET, account_id = nil, customer_id = nil, counterparty_account_id = nil, tags = nil, status = nil, type = nil, direction = nil, since = nil, _until = nil, from_amount = nil, to_amount = nil, recurring_payment_id = nil, feature = nil, sort = nil, include = nil) ⇒ ListPaymentParams
Returns a new instance of ListPaymentParams.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 28 def initialize(limit = PAYMENT_LIMIT, offset = PAYMENT_OFFSET, account_id = nil, customer_id = nil, counterparty_account_id = nil, = nil, status = nil, type = nil, direction = nil, since = nil, _until = nil, from_amount = nil, to_amount = nil, recurring_payment_id = nil, feature = nil, sort = nil, include = nil) @limit = limit @offset = offset @account_id = account_id @customer_id = customer_id @counterparty_account_id = counterparty_account_id @tags = @status = status @type = type @direction = direction @since = since @until = _until @from_amount = from_amount @to_amount = to_amount @recurring_payment_id = recurring_payment_id @feature = feature @sort = sort @include = include end |
Instance Attribute Details
#_until ⇒ Object (readonly)
Returns the value of attribute _until.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def _until @_until end |
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def account_id @account_id end |
#counterparty_account_id ⇒ Object (readonly)
Returns the value of attribute counterparty_account_id.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def counterparty_account_id @counterparty_account_id end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def customer_id @customer_id end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def direction @direction end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def feature @feature end |
#from_amount ⇒ Object (readonly)
Returns the value of attribute from_amount.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def from_amount @from_amount end |
#include ⇒ Object (readonly)
Returns the value of attribute include.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def include @include end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def offset @offset end |
#recurring_payment_id ⇒ Object (readonly)
Returns the value of attribute recurring_payment_id.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def recurring_payment_id @recurring_payment_id end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def since @since end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def sort @sort end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def status @status end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def @tags end |
#to_amount ⇒ Object (readonly)
Returns the value of attribute to_amount.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def to_amount @to_amount end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 9 def type @type end |
Instance Method Details
#to_hash ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/unit/models/payment/list_payment_params.rb', line 52 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[accountId]": account_id, "filter[customerId]": customer_id, "filter[counterpartyAccountId]": counterparty_account_id, "filter[tags]": , "filter[since]": since, "filter[until]": _until, "filter[fromAmount]": from_amount, "filter[toAmount]": to_amount, "filter[recurringPaymentId]": recurring_payment_id, sort: sort, include: include&.join(",") } filters = %i[status type direction feature] filters.each do |filter| values = send(filter) values&.each_with_index&.map do |val, index| params.merge!({ "filter[#{filter}][#{index}]": val }) end end params.compact end |