Created
April 19, 2014 20:49
-
-
Save anonymous/11097083 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Person | |
def self.owns_house | |
# Is there a way of just setting an instance variable here, | |
# rather than having to define a method? I'd like to access | |
# @owns_house from within class John. | |
define_method :owns_house do | |
true | |
end | |
end | |
end | |
class John < Person | |
owns_house | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment