Skip to content

Instantly share code, notes, and snippets.

@brianstorti
Created November 8, 2011 23:47
Show Gist options
  • Save brianstorti/1349745 to your computer and use it in GitHub Desktop.
Save brianstorti/1349745 to your computer and use it in GitHub Desktop.
Ruby class variable
class A
@@var = "a"
def test
@@var
end
end
class B < A
@@var = "b"
end
a = A.new
a.test # => "b" #FFFUUUUUU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment