Class: Basketball::Draft::Event
- Defined in:
- lib/basketball/draft/event.rb
Overview
Describes what all Room events have to have to be considered an “event”.
Instance Attribute Summary collapse
-
#front_office ⇒ Object
readonly
Returns the value of attribute front_office.
-
#round ⇒ Object
readonly
Returns the value of attribute round.
-
#round_pick ⇒ Object
readonly
Returns the value of attribute round_pick.
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(id:, front_office:, round:, round_pick:) ⇒ Event
constructor
A new instance of Event.
- #to_s ⇒ Object
Methods inherited from Entity
#<=>, #==, #comparable_id, #hash
Constructor Details
#initialize(id:, front_office:, round:, round_pick:) ⇒ Event
Returns a new instance of Event.
9 10 11 12 13 14 15 16 17 |
# File 'lib/basketball/draft/event.rb', line 9 def initialize(id:, front_office:, round:, round_pick:) super(id) raise ArgumentError, 'front_office required' unless front_office @front_office = front_office @round = round.to_i @round_pick = round_pick.to_i end |
Instance Attribute Details
#front_office ⇒ Object (readonly)
Returns the value of attribute front_office.
7 8 9 |
# File 'lib/basketball/draft/event.rb', line 7 def front_office @front_office end |
#round ⇒ Object (readonly)
Returns the value of attribute round.
7 8 9 |
# File 'lib/basketball/draft/event.rb', line 7 def round @round end |
#round_pick ⇒ Object (readonly)
Returns the value of attribute round_pick.
7 8 9 |
# File 'lib/basketball/draft/event.rb', line 7 def round_pick @round_pick end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/basketball/draft/event.rb', line 19 def to_s "[#{id}] R:#{round} P:#{round_pick} - #{front_office}" end |