class

Term2::Components::Spinner

Inherits Term2::Model < Reference < Object

Constants

DOT = Type.new(["⣾ ", "⣽ ", "⣻ ", "⢿ ", "⡿ ", "⣟ ", "⣯ ", "⣷ "], 100.milliseconds)
ELLIPSIS = Type.new(["", ".", "..", "..."], 333.milliseconds)
GLOBE = Type.new(["🌍", "🌎", "🌏"], 250.milliseconds)
HAMBURGER = Type.new(["☱", "☲", "☴", "☲"], 333.milliseconds)
JUMP = Type.new(["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"], 100.milliseconds)
LINE = Type.new(["|", "/", "-", "\\"], 100.milliseconds)

Standard types

METER = Type.new(["▱▱▱", "▰▱▱", "▰▰▱", "▰▰▰", "▰▰▱", "▰▱▱", "▱▱▱"], 140.milliseconds)
MINI_DOT = Type.new(["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], 80.milliseconds)
MONKEY = Type.new(["🙈", "🙉", "🙊"], 333.milliseconds)
MOON = Type.new(["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"], 125.milliseconds)
POINTS = Type.new(["∙∙∙", "●∙∙", "∙●∙", "∙∙●"], 140.milliseconds)
PULSE = Type.new(["█", "▓", "▒", "░"], 125.milliseconds)
SPINNER_LIST = [LINE, DOT, MINI_DOT, JUMP, PULSE, POINTS, GLOBE, MOON, MONKEY, METER, HAMBURGER, ELLIPSIS]

List of built-in spinners (parity with the Go bubbles spinner).

Constructors

new(type : Type = LINE)
Source

Instance methods

frame_index
Source
frame_index=(frame_index : Int32)
Source
style
Source
style=(style : Style)
Source
tick
Source
type
Source
type=(type : Type)
Source
update(msg : Msg) : Tuple(Spinner, 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