In article <5cd596d6050927105154fafd66 / mail.gmail.com>,
Jim Freeze  <jim / freeze.org> wrote:
>Wow, thanks for all the responses.
>
>First, duh, yeah, I got it backwards (pod and peas should be reversed.)
>
>So, from what I have read, we have:
>
>  1. Pod.new.each { |pea| ... }
>  2. Pod.new.peas.each { |pea| ... }
>
>#2 compromises the OO integrity. I understand that, but
>I guess I am bugged by #1 where Pod.new.each yields a 'pea'.
>If I see a Pod.each, I kind of expect to get a 'pod' back, not
>a pea. That is the reason I did #each_pod.
>
>Any comments on this?
>


what if youcalled the iterator function each_pea?

  Pod.new.each_pea {|pea| ... }

Of course then certain Enumerable magic won't work...

But if you consider that a Pod is a container for Peas then even the 'each' 
iterator  makes sense, I think.

Phil