struct SpdRns::Membership

Defined in:

spdrns/membership.cr

Constant Summary

ACTIONS = [:join, :unjoin, :ready, :unready, :done, :undone, :fail, :forfeit, :desert]

State Transitions

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(user : SpdRns::User, role : SpdRns::Membership::Role = Role::Observer, state : SpdRns::Membership::State = State::Registered) #

[View source]

Class Method Detail

def self.observer(user) #

[View source]
def self.participant(user) #

[View source]

Instance Method Detail

def desert(race : Race) #

[View source]
def done(race : Race) #

[View source]
def done? #

[View source]
def fail(race : Race) #

[View source]
def forfeit(race : Race) #

[View source]
def join(race : Race) #

[View source]
def ready(race : Race) #

[View source]
def ready? #

[View source]
def role : Role #

[View source]
def role=(role : Role) #

[View source]
def state : State #

[View source]
def state=(state : State) #

[View source]
def time : Time::Span | Nil #

[View source]
def time=(time : Time::Span | Nil) #

[View source]
def to(role : Role) #

[View source]
def to_observer #

[View source]
def to_participant #

Roles


[View source]
def transition(to new_state : State, from old_states = nil) #

[View source]
def undone(race : Race) #

[View source]
def unjoin(race : Race) #

[View source]
def unready(race : Race) #

[View source]
def user : User #

[View source]
def user=(user : User) #

[View source]