When you include a module, its methods DO NOT replace the methods defined in this class, but rather are introduced into the inheritance chain. Thus, when calling super , the method from the included module is called.
They will behave almost the same as with other modules. When a module is turned on, it is placed directly above the class in the inheritance chain with the modules existing above it. Example:
module Mym def hello puts "am in the module" end end module Mym2 def hello puts "am in the module2" super end end class Myc include Mym include Mym2 def hello puts "im in a class" super end end puts Myc.new.hello
See this post for more details.
Also read the following: http://rhg.rubyforge.org/chapter04.html
source share