Class: Stash::Rewards::StashReward

Inherits:
Object
  • Object
show all
Defined in:
lib/stash/rewards/stash_reward.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/stash/rewards/stash_reward.rb', line 6

def description
  @description
end

#pricesObject (readonly)

Returns the value of attribute prices.



6
7
8
# File 'lib/stash/rewards/stash_reward.rb', line 6

def prices
  @prices
end

#reward_idObject (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_nameObject (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