Hi Brad,

Sorry, I missed that Hash inherits from Enumerable (and I've filed a
doc bug on it[1] and will fix it -- the doc page for Hash doesn't
mention Enumerable).

So I think that's your answer:  Hash#filter is an alias for
Enumerable#findAll[2], which is documented as returning an array, not
a Hash, and so having it return a Hash would be breaking the contract.

[1] http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/535
[2] http://prototypejs.org/api/enumerable/findall

Sorry again to have missed the Enumerable thing in the first place.
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Feb 3, 12:25 am, Brad <bradavo...@gmail.com> wrote:
> It does. Hash still inherits from Enumerable, hence the usage of
> Hash#findAll().
>
> - Brad
>
> On Feb 2, 1:34 am, ColinFine <colin.f...@pace.com> wrote:
>
> > On Jan 31, 11:11 pm, Brad <bradavo...@gmail.com> wrote:
>
> > > Yup, found it -http://dev.rubyonrails.org/ticket/3592
>
> > > It is indeed a bug in Prototype that hasn't been addressed.
>
> > > - Brad
>
> > But it seems to me that it's gone away, because Hash no longer mixes
> > in Enumerable, does it?
>
> > Colin
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to