question regarding rails framework code

Posted by Joseph Misiti on Stack Overflow See other posts from Stack Overflow or by Joseph Misiti
Published on 2010-05-26T19:54:02Z Indexed on 2010/05/26 20:01 UTC
Read the original article Hit count: 381

Filed under:
|

I noticed that the code in the rails framework is using the following convention all over the place:

class SomeClass
  class << self
     def some function
     end
  end
end

rather than

class SomeClass
end

def SomeClass.function
end

and

class SomeClass
  def self.somefunction
  end
end

What is the reason for this design choice? They all seem to accomplish them same thing

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby