Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/cem/ccommon.rb
Instance Method Summary collapse
Instance Method Details
#with_progress(&block) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/cem/ccommon.rb', line 85 def with_progress(&block) crequire 'progress_bar' = ProgressBar.new(count) if block each{|obj| yield(obj).tap{.increment!}} else Enumerator.new{ |yielder| self.each do |obj| (yielder << obj).tap{.increment!} end } end end |