Module: Enumerable
- Defined in:
- lib/core_ext/enumerable.rb
Overview
We enhance all enumerable objects (e.g. Array
, Hash
, Range
, ...) by extending the Enumerable
module.
This mixin is only supposed to be present on objects that provide an #each
method.
Instance Method Summary collapse
-
#with_progress(options = {}) ⇒ Enumerable
(also: #tqdm)
Returns a clone of
self
where all calls to#each
and related methods will print an animated progress bar while iterating.
Instance Method Details
#with_progress(options = {}) ⇒ Enumerable Also known as: tqdm
Returns a clone of self
where all calls to #each
and related methods will print an animated progress bar
while iterating.
21 22 23 |
# File 'lib/core_ext/enumerable.rb', line 21 def with_progress( = {}) Tqdm::Decorator.new(self, ).enhance end |