建立类方法 发表于 2013-06-14 | 1234567891011121314First way:class MyClass class << self def my_method; end endendSecond Way:class MyClass def self.my_method; endendThird Way:def MyClass.my_other_method; end