2007-12-28から1日間の記事一覧

オーバーライドされた元のメソッドを呼ぶ

もう少しスマートなやり方があるような気が。 class Foo def initialize @val = 'foo val' end def func @val end end class Bar < Foo def initialize @val = 'bar val' end def func 'Bar#func' end end foo = Foo.new bar = Bar.new puts bar.func puts F…