class

Session

Inherits Reference < Object

An ephemeral ranking session. Owns the two-phase state machine and guards every mutation. Pure Crystal: no HTTP, no clock of its own — the caller passes the current time.

Constructors

new(code : String, facilitator_token : String, created_at : Time, ttl : Time::Span)
Source

Instance methods

code
Source
expired?(now : Time) : Bool
Source
facilitator_token
Source
join(id : String, name : String) : Participant

A newcomer after reveal is admitted, but the phase guards keep them from submitting — they observe only.

Source
mark_ready(id : String) : Nil
Source
participant(id : String) : Participant | Nil
Source
phase
Source
public_view(for viewer_id : String) : SessionView

Confidentiality lives here: a ranking is placed in the view only when the session is revealed or when it belongs to the viewer themselves.

Source
reveal(token : String) : Nil
Source
revealed?
Source
submit(id : String, ranking : Ranking) : Nil
Source

Nested types