Class: AdLint::ProgressMonitor
- Inherits:
-
Object
- Object
- AdLint::ProgressMonitor
- Defined in:
- lib/adlint/monitor.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#progress ⇒ Object
Returns the value of attribute progress.
Instance Method Summary collapse
- #abort ⇒ Object
- #finish ⇒ Object
-
#initialize(fpath, phase_num, verbose) ⇒ ProgressMonitor
constructor
A new instance of ProgressMonitor.
- #start(title, total = 1) ⇒ Object
Constructor Details
#initialize(fpath, phase_num, verbose) ⇒ ProgressMonitor
Returns a new instance of ProgressMonitor.
65 66 67 68 69 70 71 |
# File 'lib/adlint/monitor.rb', line 65 def initialize(fpath, phase_num, verbose) @fpath = fpath @phase_num = phase_num @verbose = verbose @start_time = Time.now @cur_phase = 0 end |
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
73 74 75 |
# File 'lib/adlint/monitor.rb', line 73 def location @location end |
#progress ⇒ Object
Returns the value of attribute progress.
74 75 76 |
# File 'lib/adlint/monitor.rb', line 74 def progress @progress end |
Instance Method Details
#abort ⇒ Object
94 95 96 |
# File 'lib/adlint/monitor.rb', line 94 def abort draw_aborted end |
#finish ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/adlint/monitor.rb', line 85 def finish @progress = @total if @cur_phase == @phase_num draw_finished else draw end end |
#start(title, total = 1) ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/adlint/monitor.rb', line 76 def start(title, total = 1) @total = total @title = title @location = nil @progress = 0 @cur_phase += 1 draw end |