View Source FiveHundredWeb.GameStarter (Five Hundred v0.1.0)

Link to this section Summary

Functions

Create the GameStart struct data from the changeset if valid.

Get the game code to use for starting or joining the game.

Link to this section Types

@type t() :: %FiveHundredWeb.GameStarter{
  game_code: nil | String.t(),
  id: term(),
  player_name: nil | String.t()
}

Link to this section Functions

@spec create(params :: map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Create the GameStart struct data from the changeset if valid.

Link to this function

get_game_code(game_starter)

View Source
@spec get_game_code(t()) :: {:ok, FiveHundred.Game.game_code()} | {:error, String.t()}

Get the game code to use for starting or joining the game.