Module: Prelude::Enumerator
- Defined in:
- lib/prelude/enumerator.rb
Constant Summary collapse
- TypeMismatch =
Class.new(StandardError)
Instance Method Summary collapse
Instance Method Details
#with_prelude ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# 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 |