There is a module MyModule
:
module MyModule
extend ActiveSupport::Concern
def first_method
end
def second_method
end
included do
second_class_method
end
module ClassMethods
def first_class_method
end
def second_class_method
end
end
end
When some class include
s this module, it will have 2 methods exposed as instance methods (first_method
and second_method
) and 2 class methods (first_class_method
and second_class_method
) - it is clear.
It is said, that
included
block will be executed within the context of the class that is including the module.
What does it mean exactly? Meaning, when exactly would this method (second_class_method
) be executed?