Method: Module#included

Defined in:
object.c

#included(_y) ⇒ Object (private)

call-seq:

included(othermod)

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}"
  end
end
module Enumerable
  include A
end
 # => prints "A included in Enumerable"

1168
1169
1170
1171
1172
# File 'object.c', line 1168

static VALUE
rb_obj_dummy1(VALUE _x, VALUE _y)
{
    return rb_obj_dummy();
}