Class: SRL::Race

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

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.



117
118
119
# File 'lib/srl/typedefs.rb', line 117

def entrants
  @entrants
end

#gameObject

The game associate with this race.



110
111
112
# File 'lib/srl/typedefs.rb', line 110

def game
  @game
end

#oidObject (readonly) Also known as: channel

The IRC channel suffix for this race.



96
97
98
# File 'lib/srl/typedefs.rb', line 96

def oid
  @oid
end

#stateObject (readonly)

The state of this race. Entry Open / In Progress / Completed

FIXME

Switch to enum-like behaviour with symbols.



101
102
103
# File 'lib/srl/typedefs.rb', line 101

def state
  @state
end

Instance Method Details

#statusObject



103
104
105
106
107
# File 'lib/srl/typedefs.rb', line 103

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