Class: BruteCLI::Spinner::Base
- Inherits:
-
Object
- Object
- BruteCLI::Spinner::Base
- Defined in:
- lib/brute_cli/spinner.rb
Overview
Abstract base class for CLI spinners.
Subclasses must implement:
#start – begin the spinner animation
#stop – halt the spinner animation
#spinning? – whether the spinner is currently animating
All spinners receive an output IO via the constructor so they write through the Terminal buffer rather than directly to $stdout.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ Base
constructor
A new instance of Base.
- #spinning? ⇒ Boolean
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ Base
Returns a new instance of Base.
16 17 18 |
# File 'lib/brute_cli/spinner.rb', line 16 def initialize(output: $stdout) @output = output end |
Instance Method Details
#spinning? ⇒ Boolean
28 29 30 |
# File 'lib/brute_cli/spinner.rb', line 28 def spinning? raise NotImplementedError, "#{self.class.name} must implement #spinning?" end |
#start ⇒ Object
20 21 22 |
# File 'lib/brute_cli/spinner.rb', line 20 def start raise NotImplementedError, "#{self.class.name} must implement #start" end |
#stop ⇒ Object
24 25 26 |
# File 'lib/brute_cli/spinner.rb', line 24 def stop raise NotImplementedError, "#{self.class.name} must implement #stop" end |