Class: Unit::Transaction::ListTransactionParams
- Inherits:
-
Object
- Object
- Unit::Transaction::ListTransactionParams
- Defined in:
- lib/unit/models/transaction/list_transaction_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.
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#exclude_fees ⇒ Object
readonly
Returns the value of attribute exclude_fees.
-
#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.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#sort ⇒ Object
readonly
Returns the value of attribute sort.
-
#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 = TRANSACTION_LIST_LIMIT, offset = TRANSACTION_LIST_OFFSET, account_id = nil, customer_id = nil, query = nil, tags = nil, since = nil, _until = nil, card_id = nil, type = nil, from_amount = nil, to_amount = nil, direction = nil, exclude_fees = nil, sort = nil, include = nil) ⇒ ListTransactionParams
constructor
A new instance of ListTransactionParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = TRANSACTION_LIST_LIMIT, offset = TRANSACTION_LIST_OFFSET, account_id = nil, customer_id = nil, query = nil, tags = nil, since = nil, _until = nil, card_id = nil, type = nil, from_amount = nil, to_amount = nil, direction = nil, exclude_fees = nil, sort = nil, include = nil) ⇒ ListTransactionParams
Returns a new instance of ListTransactionParams.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 26 def initialize(limit = TRANSACTION_LIST_LIMIT, offset = TRANSACTION_LIST_OFFSET, account_id = nil, customer_id = nil, query = nil, = nil, since = nil, _until = nil, card_id = nil, type = nil, from_amount = nil, to_amount = nil, direction = nil, exclude_fees = nil, sort = nil, include = nil) @limit = limit @offset = offset @account_id = account_id @customer_id = customer_id @query = query @tags = @since = since @_until = _until @card_id = card_id @type = type @from_amount = from_amount @to_amount = to_amount @direction = direction @exclude_fees = exclude_fees @sort = sort @include = include end |
Instance Attribute Details
#_until ⇒ Object (readonly)
Returns the value of attribute _until.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def _until @_until end |
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def account_id @account_id end |
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def card_id @card_id end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def customer_id @customer_id end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def direction @direction end |
#exclude_fees ⇒ Object (readonly)
Returns the value of attribute exclude_fees.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def exclude_fees @exclude_fees end |
#from_amount ⇒ Object (readonly)
Returns the value of attribute from_amount.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def from_amount @from_amount end |
#include ⇒ Object (readonly)
Returns the value of attribute include.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def include @include end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def offset @offset end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def query @query end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def since @since end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def sort @sort end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def @tags end |
#to_amount ⇒ Object (readonly)
Returns the value of attribute to_amount.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def to_amount @to_amount end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 8 def type @type end |
Instance Method Details
#to_hash ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/unit/models/transaction/list_transaction_params.rb', line 47 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[accountId]": account_id, "filter[customerId]": customer_id, "filter[query]": query, "filter[tags]": , "filter[since]": since, "filter[until]": _until, "filter[cardId]": card_id, "filter[fromAmount]": from_amount, "filter[toAmount]": to_amount, "filter[direction]": direction, "excludeFees": exclude_fees, "sort": sort, "include": include&.join(",") } type&.each_with_index&.map do |val, index| params.merge!({ "filter[type][#{index}]": val }) end params.compact end |