Class: GameRocket::Player
- Inherits:
-
Object
- Object
- GameRocket::Player
- Includes:
- BaseModule
- Defined in:
- lib/gamerocket/player.rb
Instance Attribute Summary collapse
-
#dynProp ⇒ Object
Returns the value of attribute dynProp.
-
#emailHash ⇒ Object
Returns the value of attribute emailHash.
-
#id ⇒ Object
Returns the value of attribute id.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#name ⇒ Object
Returns the value of attribute name.
-
#totalPointsAchievements ⇒ Object
Returns the value of attribute totalPointsAchievements.
Class Method Summary collapse
- ._attributes ⇒ Object
- ._new(*args) ⇒ Object
- .create(attributes = {}) ⇒ Object
- .delete(id) ⇒ Object
- .find(id) ⇒ Object
- .update(id, attributes) ⇒ Object
Instance Method Summary collapse
- #==(other) ⇒ Object
- #delete ⇒ Object
-
#initialize(gateway, attributes) ⇒ Player
constructor
A new instance of Player.
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) ⇒ Player
Returns a new instance of Player.
7 8 9 10 |
# File 'lib/gamerocket/player.rb', line 7 def initialize(gateway, attributes) @gateway = gateway set_instance_variables_from_hash(attributes) unless attributes.nil? end |
Instance Attribute Details
#dynProp ⇒ Object
Returns the value of attribute dynProp.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def dynProp @dynProp end |
#emailHash ⇒ Object
Returns the value of attribute emailHash.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def emailHash @emailHash end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def id @id end |
#locale ⇒ Object
Returns the value of attribute locale.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def locale @locale end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def name @name end |
#totalPointsAchievements ⇒ Object
Returns the value of attribute totalPointsAchievements.
5 6 7 |
# File 'lib/gamerocket/player.rb', line 5 def totalPointsAchievements @totalPointsAchievements end |
Class Method Details
._attributes ⇒ Object
45 46 47 48 49 |
# File 'lib/gamerocket/player.rb', line 45 def self._attributes [ :id, :name, :emailHash, :totalPointsAchievements, :locale, :dynProp ] end |
._new(*args) ⇒ Object
41 42 43 |
# File 'lib/gamerocket/player.rb', line 41 def self._new(*args) self.new *args end |
.create(attributes = {}) ⇒ Object
12 13 14 |
# File 'lib/gamerocket/player.rb', line 12 def self.create(attributes = {}) Configuration.gateway.player.create(attributes) end |
.delete(id) ⇒ Object
24 25 26 |
# File 'lib/gamerocket/player.rb', line 24 def self.delete(id) Configuration.gateway.player.delete(id) end |
.find(id) ⇒ Object
16 17 18 |
# File 'lib/gamerocket/player.rb', line 16 def self.find(id) Configuration.gateway.player.find(id) end |
.update(id, attributes) ⇒ Object
20 21 22 |
# File 'lib/gamerocket/player.rb', line 20 def self.update(id, attributes) Configuration.gateway.player.update(id, attributes) end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 |
# File 'lib/gamerocket/player.rb', line 32 def ==(other) return false unless other.is_a?(Player) id == other.id end |
#delete ⇒ Object
28 29 30 |
# File 'lib/gamerocket/player.rb', line 28 def delete @gateway.player.delete(id) end |