Skip to content

Instantly share code, notes, and snippets.

@rubychan
Created July 25, 2011 15:31

Revisions

  1. @korny korny revised this gist Jul 25, 2011. 1 changed file with 16 additions and 16 deletions.
    32 changes: 16 additions & 16 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    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
    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
    => nil
  2. @korny korny created this gist Jul 25, 2011.
    17 changes: 17 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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