Class: SRL::Race
Overview
A race that has not yet been recorded or closed.
Defined Under Namespace
Classes: Entrant
Constant Summary collapse
- STATES =
[ :open, :unknown, :in_progress, :complete ].freeze
Instance Attribute Summary collapse
-
#entrants ⇒ Object
The players enlisted in this race as an array of Entrants.
-
#game ⇒ Object
The game associate with this race.
-
#goal ⇒ Object
Returns the value of attribute goal.
-
#numentrants ⇒ Object
Returns the value of attribute numentrants.
-
#oid ⇒ Object
(also: #channel)
readonly
The IRC channel suffix for this race.
-
#state ⇒ Object
readonly
The state of this race.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Methods included from Unmarshalable
Instance Attribute Details
#entrants ⇒ Object
The players enlisted in this race as an array of Entrants.
35 36 37 |
# File 'lib/srl/race.rb', line 35 def entrants @entrants end |
#game ⇒ Object
The game associate with this race.
28 29 30 |
# File 'lib/srl/race.rb', line 28 def game @game end |
#goal ⇒ Object
Returns the value of attribute goal.
44 45 46 |
# File 'lib/srl/race.rb', line 44 def goal @goal end |
#numentrants ⇒ Object
Returns the value of attribute numentrants.
47 48 49 |
# File 'lib/srl/race.rb', line 47 def numentrants @numentrants end |
#oid ⇒ Object (readonly) Also known as: channel
The IRC channel suffix for this race.
14 15 16 |
# File 'lib/srl/race.rb', line 14 def oid @oid end |
#state ⇒ Object (readonly)
The state of this race. Entry Open / In Progress / Completed
- FIXME
-
Switch to enum-like behaviour with symbols.
19 20 21 |
# File 'lib/srl/race.rb', line 19 def state @state end |
#time ⇒ Object
Returns the value of attribute time.
46 47 48 |
# File 'lib/srl/race.rb', line 46 def time @time end |
Instance Method Details
#status ⇒ Object
21 22 23 24 25 |
# File 'lib/srl/race.rb', line 21 def status STATES[state - 1] rescue :unknown end |