Skip to content

Instantly share code, notes, and snippets.

@rubychan
Created July 25, 2011 15:31
Show Gist options
  • Save rubychan/1104396 to your computer and use it in GitHub Desktop.
Save rubychan/1104396 to your computer and use it in GitHub Desktop.
playing with instance variables
ruby-1.8.7 > @foo = 42
=> 42
ruby-1.8.7 > @foo
=> 42
ruby-1.8.7 > @foo = nil
=> nil
ruby-1.8.7 > @foo
=> nil
ruby-1.8.7 > remove_instance_variable :@foo
=> nil
ruby-1.8.7 > @foo
=> nil
ruby-1.8.7 > $VERBOSE = true
=> true
ruby-1.8.7 > @foo
(irb):10: warning: instance variable @foo not initialized
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment