Class: CliSpinnable::Writer
- Inherits:
-
Object
- Object
- CliSpinnable::Writer
- Defined in:
- lib/cli_spinnable/writer.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- REFRESH_DELAY_IN_SECONDS =
0.1
Instance Method Summary collapse
- #failure ⇒ Object
- #finalize ⇒ Object
-
#initialize(output, line) ⇒ Writer
constructor
A new instance of Writer.
- #print(str) ⇒ Object
- #tick ⇒ Object
Constructor Details
#initialize(output, line) ⇒ Writer
Returns a new instance of Writer.
7 8 9 10 11 12 |
# File 'lib/cli_spinnable/writer.rb', line 7 def initialize(output, line) @output = output @line = line @queue = Queue.new @session = start_session end |
Instance Method Details
#failure ⇒ Object
27 28 29 30 31 32 |
# File 'lib/cli_spinnable/writer.rb', line 27 def failure push(:sign=, :fail) push(:newline=, true) push(:str=, '') self end |
#finalize ⇒ Object
34 35 36 37 38 |
# File 'lib/cli_spinnable/writer.rb', line 34 def finalize push(:sign=, :blank) finalize_session self end |
#print(str) ⇒ Object
14 15 16 17 18 |
# File 'lib/cli_spinnable/writer.rb', line 14 def print(str) push(:sign=, :spin) push(:<<, str) self end |
#tick ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cli_spinnable/writer.rb', line 20 def tick push(:sign=, :tick) push(:newline=, true) push(:str=, '') self end |