Created
May 18, 2010 13:48
-
-
Save workmad3/405016 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 Foobar | |
@city = "London" | |
def city | |
self.class.instance_variable_get(:@city) | |
end | |
end | |
class Barfoo < Foobar | |
@city = "New York" | |
end | |
puts Foobar.new.city | |
puts Barfoo.new.city |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment