module

Enumerable

v1_8_7_330 - Show latest stable

The Enumerable mixin provides collection classes with several traversal and searching methods, and with the ability to sort. The class must provide a method each, which yields successive members of the collection. If Enumerable#max, #min, or #sort is used, the objects in the collection must also implement a meaningful <=> operator, as these methods rely on an ordering between members of the collection.

Files

  • enum.c
  • enumerator.c
  • lib/set.rb
  • lib/soap/property.rb

Nested classes and modules

2Notes

Some methods listed for this class need require 'enumerator'

yonosoytu · Aug 23, 20082 thanks

The methods:

  • each_slice
  • enum_slice
  • each_cons
  • enum_cons
  • enum_with_index

need that you put this require in your scripts:

require 'enumerator'

Video Explanation of first, last and each

MattStopa · Mar 14, 20121 thank