Module: Async::Enumerable::Methods::Iterators

Included in:
Async::Enumerable::Methods
Defined in:
lib/async/enumerable/methods/iterators.rb

Overview

Iterators module for enumerable iteration helper methods.

Iteration helper methods are inherited from the standard Enumerable module. When used with async enumerables, these methods build on our async #each implementation, though some maintain sequential semantics where required by their nature.

Methods available through Enumerable:

  • each_with_index: Iterates with index (block executes async)
  • each_with_object: Iterates with an accumulator object (block executes async)
  • each_cons: Iterates over consecutive n-element slices (maintains order)
  • each_slice: Iterates over n-element slices (block executes async per slice)
  • cycle: Cycles through elements repeatedly (block executes async)
  • with_index: Adds index to any enumerator

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Dependency



21
22
23
# File 'lib/async/enumerable/methods/iterators.rb', line 21

def self.included(base) = base.include(Each) # Dependency
# This module is intentionally empty as iteration methods are
# inherited from Enumerable