PerlerのRuby日記

Rubyとか

2013-01-10から1日間の記事一覧

モジュールを継承したモジュールを作りたかった話

Hogeモジュールを継承したFugaモジュールを作ろうとしたらエラーになった。 module Hoge def self.hoge # 特異メソッド puts "hoge!!!" end end module Fuga < Hoge def self.hoge # 特異メソッド puts "fuga!!!" super end end Fuga.hoge SyntaxError: (irb…