# list0403.rb # モジュール module MODL1 def ability print "I can fly!\n" end def speed print "300km/h\n" end end module MODL2 def ability print "I can swim!\n" end def speed print "150km/h\n" end end class CLS1 include MODL2 end class CLS2 < CLS1 include MODL1 end class CLS3 < CLS1 end class CLS4 include MODL1 end a = CLS1.new b = CLS2.new c = CLS3.new d = CLS4.new a.ability b.ability c.ability d.ability a.speed b.speed c.speed d.speed