Last active
August 29, 2015 14:23
-
-
Save isaacsanders/dc78b58de1c9906ff341 to your computer and use it in GitHub Desktop.
Ruby Subclassing and Including
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 Foo | |
def self.included base | |
puts "Included by #{base}" | |
end | |
end | |
class Bar | |
include Foo | |
def self.inherited(base) | |
# Foo.included(base) | |
puts "Subclassed by #{base}" | |
end | |
end | |
class Baz < Bar | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment