in recent versions of Ruby, many methods in Enumerable return an Enumerator when they are called without a block:
Enumerable
Enumerator
[1,2,3,4].map #=>
easiest way for me
class Array def iter @lam = lambda {|e| puts e*3} each &@lam end end array = [1,2,3,4,5,6,7] array.iter
=> 3 6 9 12 15 18 21