Class: KillerQueenSceneScoring::Player
- Inherits:
-
Object
- Object
- KillerQueenSceneScoring::Player
- Defined in:
- lib/killer_queen_scene_scoring/player.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#points ⇒ Object
Returns the value of attribute points.
-
#scene ⇒ Object
readonly
Returns the value of attribute scene.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(config_obj) ⇒ Player
constructor
‘config_obj` is a hash that contains the player’s data from the config file.
- #to_s ⇒ Object
Constructor Details
#initialize(config_obj) ⇒ Player
‘config_obj` is a hash that contains the player’s data from the config file.
10 11 12 13 14 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 10 def initialize(config_obj) @name = config_obj[:name] @scene = config_obj[:scene] @points = 0.0 end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 6 def name @name end |
#points ⇒ Object
Returns the value of attribute points.
7 8 9 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 7 def points @points end |
#scene ⇒ Object (readonly)
Returns the value of attribute scene.
6 7 8 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 6 def scene @scene end |
Instance Method Details
#hash ⇒ Object
16 17 18 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 16 def hash to_s.hash end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/killer_queen_scene_scoring/player.rb', line 20 def to_s "#{@name} (#{@scene})" end |