The Enumerable documentation does not state explicitly that each
is an alias for each_entry
, but the description of each_entry
matches exactly what I would expect from each
.
In the examples of both answers new classes are defined, which implement the Enumerable
module and define the each
method.
Can someone give an example of a built-in class, like Array
or Hash
, which behaves differently with each
and each_entry
?