Class: Bgg::Play::Player
- Inherits:
-
Object
- Object
- Bgg::Play::Player
- Defined in:
- lib/bgg/play.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#start_position ⇒ Object
readonly
Returns the value of attribute start_position.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(player) ⇒ Player
constructor
A new instance of Player.
- #new? ⇒ Boolean
- #winner? ⇒ Boolean
Constructor Details
#initialize(player) ⇒ Player
Returns a new instance of Player.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/bgg/play.rb', line 43 def initialize(player) @color = player['color'] @name = player['name'] @new = player['new'] == '1' @rating = player['rating'] @score = player['score'] @start_position = player['startposition'] @user_id = player['userid'] @username = player['username'] @winner = player['win'] == '1' end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def color @color end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def name @name end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def @rating end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def score @score end |
#start_position ⇒ Object (readonly)
Returns the value of attribute start_position.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def start_position @start_position end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def user_id @user_id end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
41 42 43 |
# File 'lib/bgg/play.rb', line 41 def username @username end |
Instance Method Details
#new? ⇒ Boolean
55 56 57 |
# File 'lib/bgg/play.rb', line 55 def new? @new end |
#winner? ⇒ Boolean
59 60 61 |
# File 'lib/bgg/play.rb', line 59 def winner? @winner end |