Class: Lhm::Printer::Percentage
Instance Method Summary collapse
- #end ⇒ Object
-
#initialize ⇒ Percentage
constructor
A new instance of Percentage.
- #notify(lowest, highest) ⇒ Object
Constructor Details
#initialize ⇒ Percentage
Returns a new instance of Percentage.
16 17 18 19 |
# File 'lib/lhm/printer.rb', line 16 def initialize super @max_length = 0 end |
Instance Method Details
#end ⇒ Object
27 28 29 30 |
# File 'lib/lhm/printer.rb', line 27 def end write('100% complete') @output.write "\n" end |
#notify(lowest, highest) ⇒ Object
21 22 23 24 25 |
# File 'lib/lhm/printer.rb', line 21 def notify(lowest, highest) return if !highest || highest == 0 = "%.2f%% (#{lowest}/#{highest}) complete" % (lowest.to_f / highest * 100.0) write() end |