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)
SourceInstance methods
frame_index
Sourceid
Sourcestyle
Sourcestyle=(style : Style)
Sourcetick
Sourcetype
Sourcetype=(type : Type)
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.