Term2::Components::CountdownTimer
Inherits Term2::Model < Reference < Object
Constructors
new(duration : Time::Span, remaining : Time::Span, running : Bool, last_tick : Time | Nil, interval : Time::Span = 100.milliseconds)
SourceInstance methods
duration
Sourceinit
Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.
interval
Sourcelast_tick
Sourceremaining
Sourcerunning?
Sourceschedule_tick
SourceUpdate is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.
view
View renders the program's UI, which is just a string. The view is rendered after every Update.