Class: ProgressMonitor::Display
- Inherits:
-
Object
- Object
- ProgressMonitor::Display
- Defined in:
- lib/progress_monitor/display.rb,
lib/progress_monitor/display/renderer.rb,
lib/progress_monitor/display/input_loop.rb,
lib/progress_monitor/display/timer_loop.rb,
lib/progress_monitor/display/message_loop.rb,
lib/progress_monitor/display/progress_bar.rb,
lib/progress_monitor/display/task_observer.rb
Defined Under Namespace
Classes: InputLoop, MessageLoop, ProgressBar, Renderer, TaskObserver, TimerLoop
Instance Attribute Summary collapse
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(task) ⇒ Display
constructor
A new instance of Display.
Constructor Details
#initialize(task) ⇒ Display
Returns a new instance of Display.
13 14 15 16 |
# File 'lib/progress_monitor/display.rb', line 13 def initialize(task) @task = task @queue = Queue.new end |
Instance Attribute Details
#task ⇒ Object (readonly)
Returns the value of attribute task.
11 12 13 |
# File 'lib/progress_monitor/display.rb', line 11 def task @task end |
Instance Method Details
#display ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/progress_monitor/display.rb', line 18 def display @current_task = task @renderer = Renderer.new(task) @renderer.refresh task.add_observer TaskObserver.new(queue) @main_thread = Thread.current Thread.new { InputLoop.new(queue).perform } Thread.new { TimerLoop.new(queue).perform } Thread.new { MessageLoop.new(queue, @main_thread, @renderer).perform } end |