Nice one, Tom!
As far as naming I'd rather go with same pluck but with optional
second argument for setting value
$$('#myFormId input').pluck('disabled'); // getter
$$('#myFormId input').pluck('disabled', true); // setter
You have no idea how much confusion there's among beginners as far as
figuring out all these "weird" Enumerable methods (specially if you're
not familiar with Ruby).
Introducing another one, I believe, would bring even more chaos.
P.S.
Since we're on this subject, has anyone ever considered having case-
insensitive flag for Array's without method.
$('nav').descendants().pluck('tagName').without('LI') (i.e. when
dealing with HTML vs XML case issues)
I know, this case is pretty trivial and could be simply done with
selectors:
$$('#nav li a')
but wouldn't it be still usefull to have such option?
Best,
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---