There are different ways to create class methods in Ruby. These three are probably the most common ones. They all do the same.
class Blog def self.foo puts 'I am a class method' end def Blog.bar puts 'I am a class method, too' end class << self def foobar puts 'I am another class method' end end end
There are even more ways to define class methods. Check out these two post for more:
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.