Last active
September 22, 2015 06:16
-
-
Save waynerobinson/b67e817cd372bf501de8 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 Foo | |
@@cvar = 100 | |
class << self | |
def cvar | |
@@cvar | |
end | |
attr_accessor :ivar | |
end | |
end | |
class Bar < Foo | |
@@cvar = 200 | |
end | |
Foo.cvar # 200 | |
Bar.cvar # 200 | |
Foo.ivar = 300 | |
Bar.ivar = 400 | |
Foo.ivar # 300 | |
Bar.ivar # 400 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment