Class: Stash::Rewards::StashReward
- Inherits:
-
Object
- Object
- Stash::Rewards::StashReward
- Defined in:
- lib/stash/rewards/stash_reward.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#reward_id ⇒ Object
readonly
Returns the value of attribute reward_id.
-
#reward_name ⇒ Object
readonly
Returns the value of attribute reward_name.
Instance Method Summary collapse
-
#initialize(reward_payload) ⇒ StashReward
constructor
A new instance of StashReward.
Constructor Details
#initialize(reward_payload) ⇒ StashReward
8 9 10 11 12 13 |
# File 'lib/stash/rewards/stash_reward.rb', line 8 def initialize(reward_payload) @reward_name = reward_payload['rewardName'] @reward_id = reward_payload['rewardId'] @description = reward_payload['description'] @prices = reward_payload['denominations'] || [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/stash/rewards/stash_reward.rb', line 6 def description @description end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
6 7 8 |
# File 'lib/stash/rewards/stash_reward.rb', line 6 def prices @prices end |
#reward_id ⇒ Object (readonly)
Returns the value of attribute reward_id.
6 7 8 |
# File 'lib/stash/rewards/stash_reward.rb', line 6 def reward_id @reward_id end |
#reward_name ⇒ Object (readonly)
Returns the value of attribute reward_name.
6 7 8 |
# File 'lib/stash/rewards/stash_reward.rb', line 6 def reward_name @reward_name end |