included(p1) private

Callback invoked whenever the receiver is included in another module or class. This should be used in preference to Module.append_features if your code wants to perform some action when a module is included in another.

module A
  def A.included(mod)
    puts "#{self} included in #{mod}"
module Enumerable
  include A
 # => prints "A included in Enumerable"
Show source
Register or log in to add new notes.