Class: GameRocket::Achievement
- Inherits:
-
Object
- Object
- GameRocket::Achievement
- Includes:
- BaseModule
- Defined in:
- lib/gamerocket/achievement.rb
Instance Attribute Summary collapse
-
#dynProp ⇒ Object
Returns the value of attribute dynProp.
-
#id ⇒ Object
Returns the value of attribute id.
-
#progression ⇒ Object
Returns the value of attribute progression.
-
#template ⇒ Object
Returns the value of attribute template.
-
#unlocked ⇒ Object
Returns the value of attribute unlocked.
-
#unlockedDate ⇒ Object
Returns the value of attribute unlockedDate.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gateway, attributes) ⇒ Achievement
constructor
A new instance of Achievement.
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(gateway, attributes) ⇒ Achievement
Returns a new instance of Achievement.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gamerocket/achievement.rb', line 7 def initialize(gateway, attributes) @gateway = gateway if attributes.is_a?(Hash) set_instance_variables_from_hash(attributes) self.dynProp = attributes["dynProp"].is_a?(Hash) ? attributes["dynProp"] : {} if attributes["template"].is_a?(Hash) self.template = AchievementTemplate._new(attributes["template"]) end end end |
Instance Attribute Details
#dynProp ⇒ Object
Returns the value of attribute dynProp.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def dynProp @dynProp end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def id @id end |
#progression ⇒ Object
Returns the value of attribute progression.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def progression @progression end |
#template ⇒ Object
Returns the value of attribute template.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def template @template end |
#unlocked ⇒ Object
Returns the value of attribute unlocked.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def unlocked @unlocked end |
#unlockedDate ⇒ Object
Returns the value of attribute unlockedDate.
5 6 7 |
# File 'lib/gamerocket/achievement.rb', line 5 def unlockedDate @unlockedDate end |
Class Method Details
._new(*args) ⇒ Object
22 23 24 |
# File 'lib/gamerocket/achievement.rb', line 22 def self._new(*args) self.new *args end |
.find(player, id, params) ⇒ Object
18 19 20 |
# File 'lib/gamerocket/achievement.rb', line 18 def self.find(player, id, params) Configuration.gateway.achievement.find(player, id, params) end |