Created
September 30, 2013 17:59
Revisions
-
btm created this gist
Sep 30, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ class A @@cvar = {} def mutate @@cvar[:foo] = "bar" end def add(k,v) @@cvar[k] = v end def show p @@cvar end end a = A.new a.mutate p "before:" a.show a.add("yellow","elephant") a.show class A @@cvar = {} def mutate @@cvar[:baz] = "qux" end def show p @@cvar end end a = A.new a.mutate p "after:" a.show This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ "before:" {:foo=>"bar"} {:foo=>"bar", "yellow"=>"elephant"} "after:" {:baz=>"qux"}