Skip to content

Instantly share code, notes, and snippets.

@codesword
Last active June 5, 2016 12:05
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/bd0cea7a4d63d9178b58a77f5e558388 to your computer and use it in GitHub Desktop.
Save codesword/bd0cea7a4d63d9178b58a77f5e558388 to your computer and use it in GitHub Desktop.
class Person
@book = "Harry Porter"
def initialize
@book = "The Rails Way"
end
end
Person.instance_variable_get(:@book) #=> "Harry Porter"
Person.new.instance_variable_get(:@book) #=> "The Rails Way"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment