View Source ExPomodoro.Pomodoro (ExPomodoro v0.1.1)
This module is repsonsible for defining the domain model for the Pomodoro technique.
Link to this section Summary
Functions
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct in a break activity.
Given a Elixir.ExPomodoro.Pomodoro struct, completes the current round by assigning a new activity.
The default duration of breaks.
The default duration of the exercise.
The default rounds number.
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct with an increased round in an exercise activity.
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct in an :idle activity.
Given an id and a keyword of options, returns a new Elixir.ExPomodoro.Pomodoro struct. The options can redefine the following fields, otherwise the default values will be used
Given a Elixir.ExPomodoro.Pomodoro struct, starts a new round by increasing the current round and assigning a new activity.
Given a Elixir.ExPomodoro.Pomodoro struct and options, returns a new one with it's fields updated.
Link to this section Types
@type activity() :: :exercise | :break | :idle | :finished
@type id() :: String.t()
@type opts() :: [ exercise_duration: non_neg_integer(), break_duration: non_neg_integer(), rounds: non_neg_integer() ]
Link to this section Functions
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct in a break activity.
Given a Elixir.ExPomodoro.Pomodoro struct, completes the current round by assigning a new activity.
@spec default_break_duration() :: non_neg_integer()
The default duration of breaks.
@spec default_exercise_duration() :: non_neg_integer()
The default duration of the exercise.
@spec default_rounds() :: non_neg_integer()
The default rounds number.
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct with an increased round in an exercise activity.
Given a Elixir.ExPomodoro.Pomodoro struct, returns a new struct in an :idle activity.
Given an id and a keyword of options, returns a new Elixir.ExPomodoro.Pomodoro struct. The options can redefine the following fields, otherwise the default values will be used:
exercise_duration
: the amount of time intended to spend on task completion, in milliseconds (default:25
minutes).break_duration
: the amount of time the break lasts, in milliseconds (default:5
minutes).rounds
: the number of rounds until the pomodoro finishes (default:4
).
Given a Elixir.ExPomodoro.Pomodoro struct, starts a new round by increasing the current round and assigning a new activity.
Given a Elixir.ExPomodoro.Pomodoro struct and options, returns a new one with it's fields updated.