Created
October 20, 2009 15:19
-
-
Save bdimcheff/214323 to your computer and use it in GitHub Desktop.
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
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