From: Joey Zhou Date: 2011-04-20T11:23:57+09:00 Subject: Re: How to use Enumerator::Generator in Ruby 1.9.2 May I think like this, Enumerator.new is a short way, including two steps: eg = Enumerator::Generator.new {|y| y << 1 } p eg # # e1 = Enumerator.new(eg) p e1 # #:each> e2 = eg.to_enum p e2 # #:each> so ruby-doc says there are two forms of Enumerator.new: Enumerator.new(obj, method = :each, *args) Enumerator.new { |y| ... } in fact, there's just one, the second one can be regarded as Enumerator.new(enum_generator_instance) Does Enumerator::Generator exist, because Ruby 1.8 has a Generator class? -- Posted via http://www.ruby-forum.com/.