Ruby self.extended gets called as instance method
问题 module Country def location puts "location" end def self.included(base) def cities puts "cities" end end def self.extended(base) def animals puts "animals" end end end class Test include Country end class Test2 extend Country end As far as I understand, self.included will be invoked when the module is being included as instance method where as self.extended will be invoked when the module is being extended as static class method. But when I have two class in the same file, why it's not