class Drumknott::Outputs::ProgressBar

Public Instance Methods

call(label, collection) click to toggle source
# File lib/drumknott/outputs/progress_bar.rb, line 4
def call(label, collection)
  bar = ::ProgressBar.create :title => label, :total => collection.length

  collection.each do |item|
    block.call item
    bar.increment
  end
end