Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/progress-meter.rb

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object



157
158
159
160
161
162
163
164
165
166
# File 'lib/progress-meter.rb', line 157

def each (&block)
  if Progress.active?  then
    progress_meters = Progress::progress_meters
    progress_meters.push(Progress.new(self.length, progress_meters.size ))
    orig_each {|k,v|block.call(k,v);progress_meters.last.tick;}
    progress_meters.pop
  else
    orig_each &block
  end
end

#orig_eachObject



156
# File 'lib/progress-meter.rb', line 156

alias :orig_each :each