From: Love U Ruby Date: 2013-05-13T20:49:15+09:00 Subject: Re: Enum#each issue Love U Ruby wrote in post #1108765: > Adam Prescott wrote in post #1108763: >> On 13 May 2013 12:16, Love U Ruby wrote: > > The below point I didn't get,can you help me a bit more to understand > your sentences. > >> Since the Enumerator wrapper around "string" is lazy, there is no >> error with "string".to_enum, but that doesn't mean String#each doesn't >> exist. > > Here also I am getting the same errors: > > When I running the below: > > p e = "string".to_enum.class #=> Enumerator > p e = "string".to_enum #=> # > e.next #=> so.rb:2:in `
': undefined method `next' for > Enumerator:Class (NoMethodError) As the first line telling `e` is an instance of class `Enumerator`, then why the method `next` not working? This is my pain point. -- Posted via http://www.ruby-forum.com/.