Slides

Enumerators

This topic is too advanced for a two-day Ruby class.

Ref. WGR Chapter 10

Enumerable

  • Enumerable is a module you can mix in to your own classes
  • Your class has to define an each method (only requirement)

Enumerable Methods

Enumerable.instance_methods(false).sort

Enumerators

  • similar to iterators
  • iterator is a method
  • enumerator is an object