Class: InOrOut::Player
- Inherits:
-
Object
- Object
- InOrOut::Player
- Defined in:
- lib/in_or_out/models/player.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#team ⇒ Object
readonly
Returns the value of attribute team.
Instance Method Summary collapse
-
#initialize(player_name, team_name, **options) ⇒ Player
constructor
A new instance of Player.
- #status ⇒ Object
Constructor Details
#initialize(player_name, team_name, **options) ⇒ Player
Returns a new instance of Player.
6 7 8 9 |
# File 'lib/in_or_out/models/player.rb', line 6 def initialize(player_name, team_name, **) @name, @team = player_name, team_name @number, @position, @status = [:number], [:position], [:status] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/in_or_out/models/player.rb', line 4 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
4 5 6 |
# File 'lib/in_or_out/models/player.rb', line 4 def number @number end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
4 5 6 |
# File 'lib/in_or_out/models/player.rb', line 4 def position @position end |
#team ⇒ Object (readonly)
Returns the value of attribute team.
4 5 6 |
# File 'lib/in_or_out/models/player.rb', line 4 def team @team end |
Instance Method Details
#status ⇒ Object
21 22 23 24 |
# File 'lib/in_or_out/models/player.rb', line 21 def status evaluate_status unless @status @status end |