Sha256: e180272be5039e5a313aff7f3ee74f64e388e7cab43eda4e90e3f9bd33af79f9

Contents?: true

Size: 344 Bytes

Versions: 3

Compression:

Stored size: 344 Bytes

Contents

class Integer
  # note that Progress.step is called automatically
  # ==== Example
  #   100.times_with_progress('Numbers') do |number|
  #     sleep(number)
  #   end
  def times_with_progress(title = nil)
    Progress.start(title, self) do
      times do |i|
        Progress.step do
          yield i
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
progress-1.1.1 lib/progress/integer.rb
progress-1.1.0 lib/progress/integer.rb
progress-1.0.1 lib/progress/integer.rb