enum.each_entry { |obj| block } â enum
enum.each_entry â an_enumerator
enum.each_entry â an_enumerator
Instance Public methods
Calls block once for each element in self
, passing
that element as a parameter, converting multiple values from yield to an
array.
If no block is given, an enumerator is returned instead.
1 2 3 4 5 6 7 8 9 | class Foo include Enumerable def each yield 1 yield 1 , 2 yield end end Foo. new .each_entry{ |o| p o } |
produces:
1 2 3 | 1 [ 1 , 2 ] nil |
Please login to continue.