Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Last active August 29, 2015 14:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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