Created
February 7, 2013 11:19
-
-
Save yarmand/4730382 to your computer and use it in GitHub Desktop.
If you include a module more than once, included get called every time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
def self.included(base) | |
puts "A included in #{base}" | |
end | |
end | |
class B | |
include A | |
end | |
class B | |
include A | |
end | |
========== result ========== | |
A included in B | |
A included in B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment