From: Kirk Haines Date: 2004-07-01T01:15:38+09:00 Subject: Re: Opinions on library interface design? On Thu, 1 Jul 2004 01:02:52 +0900, Ara.T.Howard wrote > i was unaware - sounds super cool - i'll check it out today. I have a couple of super stupid bugs in the current release at rubyforge. I'll release a slight update shortly that fixes them. You can find some docs at: http://enigo.com/projects/kansas It can be downloaded at: http://rubyforge.org/projects/kansas > i like the idea of NOT using 'select' since, in essence these object > have not been 'selected' as our working set - we would only be > looking at them. to me that suggests a completely new method name, > something like > > def browse criteria, as = Hash > cb = block_given? > accum = [] > > query(criteria) do |intermediate| > res = > case as > when Hash > intermediate.to_h > when Array > intermediate.to_a > when Struct > intermediate.to_su > else > as.new intermediate > end > > cb ? yield res : accum << res > end > > cb ? self : accum > end > > which provide some canned types to be returns and would provide user > defineable types to be returned (case - else). That's a good idea. I like the method name, too. I'm going to give this a whirl in some code I'm writing now. Thanks, Kirk Haines