From: Ryan Leavengood Date: 2005-11-02T00:03:45+09:00 Subject: Re: "Readability" inflation On 10/31/05, Trans wrote: > > Now what kind of use real might it have besides ObjectSpace? Simply > imagine any class that might have multipe each methods: > > class House > include EnumerableArgs > > def each_bedroom ... > def each_closet ... > def each_room ... > def each_hallway ... > > def each(which=:room, &blk) > send("each_#{which}", &blk) > end > end > > h = House.new > h.select(:bathroom) { |b| ... } I see your point, but: require 'enumerator' h = House.new h.enum_for(:each_bathroom).select {|b| ... } I *really* don't see how yours is much better. In fact, I'd argue the enumerator one is better because it is more explicit...anyone who knows how enumerator works can see what is happening. Only you, me and the people paying attention to this thread would understand what the EnumeratorArgs thing was doing. But I guess we will just have to agree to disagree, since we are both dragging this into one of those endless discussions threads that I dislike so much ;) Signing off, Ryan