Method: Progress#initialize
- Defined in:
- lib/progress.rb
#initialize(total, title) ⇒ Progress
Returns a new instance of Progress.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/progress.rb', line 55 def initialize(total, title) if !total.is_a?(Numeric) && (title.nil? || title.is_a?(Numeric)) total, title = title, total end total = total && total != 0 ? Float(total) : 1.0 @total = total @current = 0.0 @title = title @mutex = Mutex.new end |