class

Term2::Components::Timer

Inherits Term2::Model < Reference < Object

Constructors

new(timeout : Time::Span, interval : Time::Span = 1.second)
Source

Instance methods

init

Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.

Source
interval
Source
interval=(interval : Time::Span)
Source
running=(running : Bool)
Source
running?
Source
start
Source
stop
Source
tick_cmd
Source
timed_out=(timed_out : Bool)
Source
timed_out?
Source
timeout
Source
timeout=(timeout : Time::Span)
Source
toggle
Source
update(msg : Msg) : Tuple(Timer, Cmd)

Update is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.

Source
view

View renders the program's UI, which is just a string. The view is rendered after every Update.

Source

Nested types