Class: Starcraft2::Reward
- Inherits:
-
Object
- Object
- Starcraft2::Reward
- Defined in:
- lib/starcraft2/reward.rb
Instance Attribute Summary collapse
-
#achievement_id ⇒ Object
Returns the value of attribute achievement_id.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#id ⇒ Object
Returns the value of attribute id.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Reward
constructor
A new instance of Reward.
Constructor Details
Instance Attribute Details
#achievement_id ⇒ Object
Returns the value of attribute achievement_id.
3 4 5 |
# File 'lib/starcraft2/reward.rb', line 3 def achievement_id @achievement_id end |
#icon ⇒ Object
Returns the value of attribute icon.
3 4 5 |
# File 'lib/starcraft2/reward.rb', line 3 def icon @icon end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/starcraft2/reward.rb', line 3 def id @id end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/starcraft2/reward.rb', line 3 def title @title end |
Class Method Details
.build(rewards_json) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/starcraft2/reward.rb', line 9 def self.build(rewards_json) data = JSON.parse(rewards_json) data['portraits'].map do |reward| new(reward) end end |