Class: SRL::Race::Entrant

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

Overview

A participant in an active race.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Unmarshalable

included

Instance Attribute Details

#displaynameObject (readonly) Also known as: name

This entrant’s player name.



54
55
56
# File 'lib/srl/race.rb', line 54

def displayname
  @displayname
end

#messageObject (readonly) Also known as: comment

The comment entered by this entrant for this race, if applicable.



66
67
68
# File 'lib/srl/race.rb', line 66

def message
  @message
end

#placeObject (readonly) Also known as: position

The position that this entrant finished this race in.



61
62
63
# File 'lib/srl/race.rb', line 61

def place
  @place
end

#statetextObject (readonly)

The state of this entrant in the race. Is he ready, finished, neither?

FIXME

Switch to an enum-like implementation with symbols.



85
86
87
# File 'lib/srl/race.rb', line 85

def statetext
  @statetext
end

#timeObject (readonly)

The number of seconds that this entrant took to complete the race goal.

Notes

A time of -1 indicates a forfeit.



74
75
76
# File 'lib/srl/race.rb', line 74

def time
  @time
end

#twitchObject (readonly)

This entrant’s Twitch account name.



58
59
60
# File 'lib/srl/race.rb', line 58

def twitch
  @twitch
end

Instance Method Details

#forfeit?Boolean

Did this entrant forfeit the race?

Returns:

  • (Boolean)


77
78
79
# File 'lib/srl/race.rb', line 77

def forfeit?
  time == -1
end