On Sunday 21 May 2006 02:53, Maninder, Singh wrote: [snip] > In the first case when I created an object, I can use it as > Browser.getName() whereas in the second case when I used Class.create(), I > need to first do > > new Browser(); > Browser.getName();
not necessarily. With Class.create() (and I'm sure with just using regular javascript prototyping) you can have instance methods AND class methods, like in ruby. See for example, the following test page I threw together: http://edge/~kitchen/class.html I implemented a class with Class.create() called Testing, and defined some class methods and instance methods and then instantiated an instance of Testing and made some calls :) -Jeremy
pgpDtcYQoVhrY.pgp
Description: PGP signature
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs