Skip to content

Instantly share code, notes, and snippets.

Created April 19, 2014 20:49
Show Gist options
  • Save anonymous/11097083 to your computer and use it in GitHub Desktop.
Save anonymous/11097083 to your computer and use it in GitHub Desktop.
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