Skip to content

Instantly share code, notes, and snippets.

@bdimcheff
Created October 20, 2009 15:19
Show Gist options
  • Save bdimcheff/214323 to your computer and use it in GitHub Desktop.
Save bdimcheff/214323 to your computer and use it in GitHub Desktop.
class Foo
puts "in Foo's body"
def self.inherited(subclass)
puts "inherited #{subclass}"
end
end
class Bar < Foo
puts "in Bar's body" # after inherited
end
baz = Class.new(Foo) do
puts "in baz's body" # before inherited
end
quux = Class.new(Foo)
quux.class_eval do
puts "in quux's body" # after inherited
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment