Skip to content

Instantly share code, notes, and snippets.

@codesword
Created June 5, 2016 11:57
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 codesword/60b26b48b1178fda8c632e8a7d1b97ab to your computer and use it in GitHub Desktop.
Save codesword/60b26b48b1178fda8c632e8a7d1b97ab to your computer and use it in GitHub Desktop.
class Person
@@name = "codesword"
end
Person.class_variable_get(:@@name) #=> "codesword"
Person.class_variable_set(:@@name, "Ikem")
Person.class_variable_get(:@@name) #=> "Ikem"
Person.new.class_variable_get("@@name") #=> undefined method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment