Class: TTY::Command::Window::Spinner
- Inherits:
-
Object
- Object
- TTY::Command::Window::Spinner
- Defined in:
- lib/tty/command/window/spinner.rb
Overview
Braille spinner used in block title bars.
Constant Summary collapse
- FRAMES =
%w[⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏].freeze
Instance Method Summary collapse
-
#frame ⇒ String
The current frame without advancing.
-
#initialize ⇒ Spinner
constructor
A new instance of Spinner.
-
#tick ⇒ String
Advance and return the next frame.
Constructor Details
#initialize ⇒ Spinner
Returns a new instance of Spinner.
10 11 12 |
# File 'lib/tty/command/window/spinner.rb', line 10 def initialize @index = 0 end |
Instance Method Details
#frame ⇒ String
Returns the current frame without advancing.
24 25 26 |
# File 'lib/tty/command/window/spinner.rb', line 24 def frame FRAMES[@index] end |