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.
19 20 21 22 |
# File 'lib/lhm/printer.rb', line 19 def initialize super @max_length = 0 end |
Instance Method Details
#end ⇒ Object
30 31 32 33 |
# File 'lib/lhm/printer.rb', line 30 def end write("100% complete") @output.write "\n" end |
#notify(lowest, highest) ⇒ Object
24 25 26 27 28 |
# File 'lib/lhm/printer.rb', line 24 def notify(lowest, highest) return if !highest || highest == 0 = "%.2f%% (#{lowest}/#{highest}) complete" % (lowest.to_f / highest * 100.0) write() end |