Last active
October 22, 2017 21:39
-
-
Save Sihui/633e30b444c772094f173f951329eea7 to your computer and use it in GitHub Desktop.
Design Pattern: Singleton and YOU
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 LazyYou | |
def self.instance | |
@instance ||= new | |
end | |
private_class_method :new | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment