Skip to content

Instantly share code, notes, and snippets.

@brentd
Created January 23, 2010 20:19
Show Gist options
  • Save brentd/284776 to your computer and use it in GitHub Desktop.
Save brentd/284776 to your computer and use it in GitHub Desktop.
class A
@foo = "bar"
def self.foo
@foo
end
def foo
self.class.foo
end
end
class B < A
end
p A.new.foo # => "bar"
p B.new.foo # nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment