Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Last active August 29, 2015 14:23
Show Gist options
  • Save isaacsanders/dc78b58de1c9906ff341 to your computer and use it in GitHub Desktop.
Save isaacsanders/dc78b58de1c9906ff341 to your computer and use it in GitHub Desktop.
Ruby Subclassing and Including
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