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-p330 :001 > @foo = 42
=> 42
ruby-1.8.7-p330 :002 > @foo
=> 42
ruby-1.8.7-p330 :003 > @foo = nil
=> nil
ruby-1.8.7-p330 :004 > @foo
=> nil
ruby-1.8.7-p330 :005 > remove_instance_variable :@foo
=> nil
ruby-1.8.7-p330 :006 > @foo
=> nil
ruby-1.8.7-p330 :009 > $VERBOSE = true
=> true
ruby-1.8.7-p330 :010 > @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