Class: CMSScanner::MockedProgressBar
- Inherits:
-
Object
- Object
- CMSScanner::MockedProgressBar
- Defined in:
- lib/cms_scanner/mocked_progress_bar.rb
Overview
ProgressBar to be used in formatter w/o user_interaction such as JSON etc, to still be able to have a log of messages to output. The object must implement the methods in ruby-progressbar and used in CMSScanner, See github.com/jfelchner/ruby-progressbar
Instance Attribute Summary collapse
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#increment ⇒ Object
readonly
Returns the value of attribute increment.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(_opts = {}) ⇒ MockedProgressBar
constructor
A new instance of MockedProgressBar.
- #log(message = nil) ⇒ Mixed
- #logs ⇒ Array<String>
- #total ⇒ Integer
- #total=(_total) ⇒ Object
Constructor Details
#initialize(_opts = {}) ⇒ MockedProgressBar
Returns a new instance of MockedProgressBar.
13 14 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 13 def initialize(_opts = {}) end |
Instance Attribute Details
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
7 8 9 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 7 def finish @finish end |
#increment ⇒ Object (readonly)
Returns the value of attribute increment.
7 8 9 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 7 def increment @increment end |
Class Method Details
.create(opts = {}) ⇒ Object
9 10 11 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 9 def self.create(opts = {}) new(opts) end |
Instance Method Details
#log(message = nil) ⇒ Mixed
32 33 34 35 36 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 32 def log( = nil) return logs unless logs << end |
#logs ⇒ Array<String>
25 26 27 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 25 def logs @logs ||= [] end |
#total ⇒ Integer
17 18 19 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 17 def total 0 end |
#total=(_total) ⇒ Object
21 22 |
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 21 def total=(_total) end |