Class: SRL::Race

Inherits:
Object
  • Object
show all
Includes:
Unmarshalable
Defined in:
lib/srl/race.rb

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

Instance Method Summary collapse

Methods included from Unmarshalable

included

Instance Attribute Details

#entrantsObject

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

#gameObject

The game associate with this race.



28
29
30
# File 'lib/srl/race.rb', line 28

def game
  @game
end

#goalObject

Returns the value of attribute goal.



44
45
46
# File 'lib/srl/race.rb', line 44

def goal
  @goal
end

#numentrantsObject

Returns the value of attribute numentrants.



47
48
49
# File 'lib/srl/race.rb', line 47

def numentrants
  @numentrants
end

#oidObject (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

#stateObject (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

#timeObject

Returns the value of attribute time.



46
47
48
# File 'lib/srl/race.rb', line 46

def time
  @time
end

Instance Method Details

#statusObject



21
22
23
24
25
# File 'lib/srl/race.rb', line 21

def status
  STATES[state - 1]
rescue
  :unknown
end