Class: CMSScanner::MockedProgressBar

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_opts = {}) ⇒ MockedProgressBar

Returns a new instance of MockedProgressBar.



13
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 13

def initialize(_opts = {}); end

Instance Attribute Details

#finishObject (readonly)

Returns the value of attribute finish.



7
8
9
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 7

def finish
  @finish
end

#incrementObject (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

Parameters:

  • message (String, nil) (defaults to: nil)

Returns:

  • (Mixed)


30
31
32
33
34
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 30

def log(message = nil)
  return logs unless message

  logs << message
end

#logsArray<String>

Returns:

  • (Array<String>)


23
24
25
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 23

def logs
  @logs ||= []
end

#totalInteger

Returns:

  • (Integer)


16
17
18
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 16

def total
  0
end

#total=(_total) ⇒ Object



20
# File 'lib/cms_scanner/mocked_progress_bar.rb', line 20

def total=(_total); end