Class: Unit::Reward::ListRewardParams
- Inherits:
-
Object
- Object
- Unit::Reward::ListRewardParams
- Defined in:
- lib/unit/models/reward/list_reward_params.rb
Instance Attribute Summary collapse
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#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.
-
#receiving_account_id ⇒ Object
readonly
Returns the value of attribute receiving_account_id.
-
#rewarded_transaction_id ⇒ Object
readonly
Returns the value of attribute rewarded_transaction_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.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
-
#until_ ⇒ Object
readonly
Returns the value of attribute until_.
Instance Method Summary collapse
-
#initialize(limit = REWARD_LIMIT, offset = REWARD_OFFSET, transaction_id = nil, rewarded_transaction_id = nil, receiving_account_id = nil, customer_id = nil, card_id = nil, status = nil, since = nil, until_ = nil, tags = nil, sort = nil, include = nil) ⇒ ListRewardParams
constructor
A new instance of ListRewardParams.
- #to_hash ⇒ Object
Constructor Details
#initialize(limit = REWARD_LIMIT, offset = REWARD_OFFSET, transaction_id = nil, rewarded_transaction_id = nil, receiving_account_id = nil, customer_id = nil, card_id = nil, status = nil, since = nil, until_ = nil, tags = nil, sort = nil, include = nil) ⇒ ListRewardParams
Returns a new instance of ListRewardParams.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 25 def initialize(limit = REWARD_LIMIT, offset = REWARD_OFFSET, transaction_id = nil, rewarded_transaction_id = nil, receiving_account_id = nil, customer_id = nil, card_id = nil, status = nil, since = nil, until_ = nil, = nil, sort = nil, include = nil) @limit = limit @offset = offset @transaction_id = transaction_id @rewarded_transaction_id = rewarded_transaction_id @receiving_account_id = receiving_account_id @customer_id = customer_id @card_id = card_id @status = status @since = since @until_ = until_ @tags = @sort = sort @include = include end |
Instance Attribute Details
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_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/reward/list_reward_params.rb', line 8 def customer_id @customer_id end |
#include ⇒ Object (readonly)
Returns the value of attribute include.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def include @include end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def offset @offset end |
#receiving_account_id ⇒ Object (readonly)
Returns the value of attribute receiving_account_id.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def receiving_account_id @receiving_account_id end |
#rewarded_transaction_id ⇒ Object (readonly)
Returns the value of attribute rewarded_transaction_id.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def rewarded_transaction_id @rewarded_transaction_id end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def since @since end |
#sort ⇒ Object (readonly)
Returns the value of attribute sort.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def sort @sort end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def status @status end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def @tags end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def transaction_id @transaction_id end |
#until_ ⇒ Object (readonly)
Returns the value of attribute until_.
8 9 10 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 8 def until_ @until_ end |
Instance Method Details
#to_hash ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/unit/models/reward/list_reward_params.rb', line 43 def to_hash params = { "page[limit]": limit, "page[offset]": offset, "filter[transactionId]": transaction_id, "filter[rewardedTransactionId]": rewarded_transaction_id, "filter[receivingAccountId]": receiving_account_id, "filter[customerId]": customer_id, "filter[cardId]": card_id, "filter[since]": since, "filter[until]": until_, "filter[tags]": , "sort": sort, "include": include&.join(",") } status&.each_with_index&.map do |val, index| params.merge!({ "filter[status][#{index}]": val }) end params.compact end |