module Prelude::Enumerator

Constants

TypeMismatch

Public Instance Methods

with_prelude() { |o| ... } click to toggle source
# File lib/prelude/enumerator.rb, line 5
def with_prelude
  return to_enum(:with_prelude) unless block_given?

  raise TypeMismatch unless map(&:class).uniq.count == 1

  # Share a preloader
  Prelude.wrap(self)

  # Iterate
  each { |o| yield o }
end