From: Tony Arcieri Date: 2011-02-17T04:47:25+09:00 Subject: Defining class methods --001636c5a462bc2cba049c6b8c28 Content-Type: text/plain; charset=ISO-8859-1 It seems there are 3 ways of defining class methods (at least in common usage): 1) Defining a method on self: def self.method 2) Opening up self and defining the methods directly: class << self def method ... end 3) Placing class methods into a module, and extending a class with that: module ClassMethods def method ... end extend ClassMethods -- Which of these do you use and which do you prefer? Do you use all three? Do you think class << self is fugly and confusing? I used to use class << self quite frequently and have been shifting to using modules when dealing with a large number of class methods. I can't really say I'm a huge fan. -- Tony Arcieri Medioh! Kudelski --001636c5a462bc2cba049c6b8c28--