Skip to content

Instantly share code, notes, and snippets.

@rails3book
Created February 16, 2011 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rails3book/830086 to your computer and use it in GitHub Desktop.
Save rails3book/830086 to your computer and use it in GitHub Desktop.
class A
def self.inherited(klass)
klass.special = "OMG"
end
def self.special=(val)
@special = val
end
def self.special
@special
end
end
class B < A
end
p B.special
p A.special
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment