From: Jim Freeze Date: 2005-09-28T04:24:21+09:00 Subject: Re: Class and Iterator Design Question On 9/27/05, Jim Freeze wrote: Concerning multiple containers for an object: > Here are four methods that I can see as potential solutions: > > 1. obj.each(:container) { |element| ... } > 2. obj.each_container { |element| ... } > 3. obj.container.each { |element| ... } > 4. obj.container; obj.each { |element| ... } > > No. (4) simply sets an internal state variable to indicate which container > #each uses. Not pretty, and not thread safe, but permits Enumerable to > be used. I am curious what people think about these methods. To all you pattern experts, is there a pattern for this situation? -- Jim Freeze