2007-07-14 クラスメソッドの書き方 Ruby class Foo def Foo.bar puts "hello" end end と定義(ファイル名は「foo.rb」)。これを他のクラスから require "foo" Foo.bar とすると、「hello」が出力される。