Class: Basketball::Draft::Pick
- Defined in:
- lib/basketball/draft/pick.rb
Overview
Room event where a player is selected.
Instance Attribute Summary collapse
-
#auto ⇒ Object
readonly
Returns the value of attribute auto.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
Attributes inherited from Event
#front_office, #round, #round_pick
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(id:, front_office:, player:, round:, round_pick:, auto: false) ⇒ Pick
constructor
A new instance of Pick.
- #to_s ⇒ Object
Methods inherited from Entity
#<=>, #==, #comparable_id, #hash
Constructor Details
#initialize(id:, front_office:, player:, round:, round_pick:, auto: false) ⇒ Pick
Returns a new instance of Pick.
9 10 11 12 13 14 15 16 |
# File 'lib/basketball/draft/pick.rb', line 9 def initialize(id:, front_office:, player:, round:, round_pick:, auto: false) super(id:, front_office:, round:, round_pick:) raise ArgumentError, 'player required' unless player @player = player @auto = auto end |
Instance Attribute Details
#auto ⇒ Object (readonly)
Returns the value of attribute auto.
7 8 9 |
# File 'lib/basketball/draft/pick.rb', line 7 def auto @auto end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
7 8 9 |
# File 'lib/basketball/draft/pick.rb', line 7 def player @player end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/basketball/draft/pick.rb', line 18 def to_s "#{super} #{auto ? 'auto-' : ''}picked #{player}" end |