Talk:Ruby Programming/Syntax/Classes

Class Methods
It says currently on the module (under class methods of course):

"Class methods are declared the same way as normal methods, except that they are prefixed by self followed by a period. These methods are executed at the Class level and may be called without an object instance. They cannot access instance variables but do have access to class variables."

'Self' is fine, but maybe it should be made clear that class methods are prefixed with the class Name, which is what self would represent.

While self is advantagious, afterall, you only need to change the class name and all class methods will role into action without needing to be changed with it, there is also supposed to be an issue with using self aswell (some form of comflict between classes and subclass. I'm, still pretty new to ruby so I don't really know.) so maybe the pros and cons can be weighed out somewhere for using self?

82.46.27.150 19:24, 27 April 2006 (UTC)