Use def self.method to define singleton methods.
...
# Also possible and convenient when you
# have to define many singleton methods.
class << self
I would argue against using "class << self" especially when you have many singleton methods. If the class is large enough, it's easy to miss the "class << self" and incorrectly read a class method as an instance method.