Created
July 10, 2009 23:49
-
-
Save mhorbul/144914 to your computer and use it in GitHub Desktop.
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 characters
class MySingleton | |
@@a = 0 | |
self.class_eval do | |
def a=(v); @@a = v; end | |
def a; @@a; end | |
end | |
end | |
puts MySingleton.a # => 0 | |
MySingleton.a = 1 | |
puts MySingleton.a # => 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment