A-ha!

That puts things in context. With reference to the String "class" -
and not the String prototype - (note to self on not getting confused),
I understand that "specialChar" is meant to be used as a constant of
sorts.

And I see now that String.intepret() is being used in the "gsub()"
implementation on the String prototype, something I failed to see
before (just as I did String.specialChar() in "inspect()"
implementation).

Next question : Given as you explained that extending a class X using
the syntax in the original post is useful for associating "static"
information on X, is that information accessible only within methods
on the prototype? In other words, can I simply do :

var s = null;
String.interpret(s); // and this should return ''

outside of methods that are not created using
Object.extend(String.prototype, { ... } )?

Or dare I say, are such methods "public static"?

Thanks much.




--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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