Skip to content

Instantly share code, notes, and snippets.

@yarmand
Created February 7, 2013 11:19
Show Gist options
  • Save yarmand/4730382 to your computer and use it in GitHub Desktop.
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.
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