Class: Starcraft2::Achievement
- Inherits:
-
Object
- Object
- Starcraft2::Achievement
- Defined in:
- lib/starcraft2/achievement.rb
Instance Attribute Summary collapse
-
#achievement_id ⇒ Object
Returns the value of attribute achievement_id.
-
#category_id ⇒ Object
Returns the value of attribute category_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#points ⇒ Object
Returns the value of attribute points.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Achievement
constructor
A new instance of Achievement.
Constructor Details
#initialize(options = {}) ⇒ Achievement
Returns a new instance of Achievement.
5 6 7 |
# File 'lib/starcraft2/achievement.rb', line 5 def initialize( = {}) Utils.load(self, , {:icon => Icon}) end |
Instance Attribute Details
#achievement_id ⇒ Object
Returns the value of attribute achievement_id.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def achievement_id @achievement_id end |
#category_id ⇒ Object
Returns the value of attribute category_id.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def category_id @category_id end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def description @description end |
#icon ⇒ Object
Returns the value of attribute icon.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def icon @icon end |
#points ⇒ Object
Returns the value of attribute points.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def points @points end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/starcraft2/achievement.rb', line 3 def title @title end |
Class Method Details
.build(achievements_json) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/starcraft2/achievement.rb', line 9 def self.build(achievements_json) data = JSON.parse(achievements_json) data['achievements'].map do |achievement| new(achievement) end end |