>>801 あるモジュールに含まれるクラスのサブクラスのインスタンスの時はどうするの? module Mymod class A # あるモジュールに含まれるクラスのインスタンスか調べるメソッド(仮) def nesting?(mod) ; self.class.name =~ /#{mod}/ ; end # その一 def nesting?(mod) ; Class.nesting.include?(mod) ; end # その二 end end class B < Mymod::A ; end Mymod::A.new.nesting?(Mymod) #=> 0(true)/true B.new.nesting?(Mymod) #=> false/true