From: Jim Freeze Date: 2005-09-28T03:00:32+09:00 Subject: Re: Class and Iterator Design Question On 9/27/05, David A. Black wrote: > Why not just call that #each? (And, as others have said, possibly > include Enumerable, though only if you need the other Enumerable > stuff). Good question. 1) Pod.each { |pea| ... }. There is no indication what each will yield. 2) In some cases, there are multiple things that can be iterated through. Maybe a better example: Car.new.each_wheel { |wheel| ... } Car.new.each_headlight { |light| ... } Which directs me to do something like: Car.new.wheels.each ... Car.new.headlights.each ... which is back to the un-encapsulation that has been previously mentioned. -- Jim Freeze