Class: GameRocket::Achievement

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/gamerocket/achievement.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

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

#dynPropObject

Returns the value of attribute dynProp.



5
6
7
# File 'lib/gamerocket/achievement.rb', line 5

def dynProp
  @dynProp
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/gamerocket/achievement.rb', line 5

def id
  @id
end

#progressionObject

Returns the value of attribute progression.



5
6
7
# File 'lib/gamerocket/achievement.rb', line 5

def progression
  @progression
end

#templateObject

Returns the value of attribute template.



5
6
7
# File 'lib/gamerocket/achievement.rb', line 5

def template
  @template
end

#unlockedObject

Returns the value of attribute unlocked.



5
6
7
# File 'lib/gamerocket/achievement.rb', line 5

def unlocked
  @unlocked
end

#unlockedDateObject

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