Nowhere on that page does it say that static class methods are copied to the
prototype. If, for whatever reason, it actually IS supposed to work that
way, it's a major flaw, and should be fixed immediately. But like I said, it
wouldn't make any sense if it worked like that, and so it doesn't.

So, with that - just do what darrin suggests (which is the best way to
ensure your instance methods are truly instance only methods)... or attach
them directly to the prototype object after Class.create() is called.


On Wed, Jul 2, 2008 at 10:15 AM, Antoine Quint <[EMAIL PROTECTED]>
wrote:

>
> On Jul 2, 2008, at 17:11 , Ryan Gahl wrote:
>
> > Why would Class.create() copy static class members to the prototype?
> > That doesn't make any sense. That completely rules out the
> > possibility that the developer, you know, wanted them to remain
> > static...
>
> As far as I know, that's how Class.create works. See
> http://prototypejs.org/learn/class-inheritance
>  and more particularly the Defining class methods section: "There is
> no special support for class methods in Prototype 1.6.0. Simply define
> them on your existing classes". Then the example shows how class
> methods need to be defined _after_ the Class.create() call.
>
> Antoine
>
>
> >
>


-- 
Ryan Gahl
Manager, Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
--
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--
Inquire: 1-920-574-2218
Blog: http://www.someElement.com
LinkedIn Profile: http://www.linkedin.com/in/ryangahl

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to