Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/progress/integer.rb
Instance Method Summary collapse
-
#times_with_progress(title = nil) ⇒ Object
note that Progress.step is called automatically ==== Example 100.times_with_progress(‘Numbers’) do |number| sleep(number) end.
Instance Method Details
#times_with_progress(title = nil) ⇒ Object
note that Progress.step is called automatically
Example
100.times_with_progress('Numbers') do |number|
sleep(number)
end
7 8 9 10 11 12 13 14 15 |
# File 'lib/progress/integer.rb', line 7 def times_with_progress(title = nil) Progress.start(title, self) do times do |i| Progress.step do yield i end end end end |