From: KIYONO Koichi Date: 2003-03-14T19:49:37+09:00 Subject: [ruby-list:37321] Re: 継承されたクラスの定数の扱いについて きよの と申します。 On Fri, 14 Mar 2003 18:58:54 +0900 KIMURA Shusaku wrote: > 継承したメソッドで、サブクラスで再定義した定数値を参照するようにする方法 > はないのでしょうか? これではダメですか? class Hoge def constA 'hoge' end def foo return constA end end class Fuga < Hoge def constA 'fuga' end def bar return constA end end a = Hoge.new b = Fuga.new p a.foo p b.foo p b.bar >ruby t.rb "hoge" "fuga" "fuga" --- KIYONO Koichi E-Mail: kiyono-k@nifty.com Web Site: http://homepage2.nifty.com/cat-chy/