Class: ProgressMeterFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/progress.rb

Overview

Constructs progress meters that output progress info to the user.

Class Method Summary collapse

Class Method Details

.from_options(options) ⇒ Object

Constructs a progress meter from a hash containing the options passed on the command line.



56
57
58
59
60
61
62
63
64
# File 'lib/progress.rb', line 56

def self.from_options(options)
    pm_class = {
        "entry" => EntryCountProgressMeter,
        "time" => TimeProgressMeter
    }
    pm_class.default = NullProgressMeter

    pm_class[options[:progress]].new
end