We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea778a5 commit f105f9aCopy full SHA for f105f9a
singleton.rb
@@ -3,8 +3,7 @@ class HeroFactory
3
@@instance = nil
4
5
def self.instance
6
- @@instance = HeroFactory.send(:new) unless @@instance
7
- @@instance
+ @@instance ||= HeroFactory.send(:new)
8
end
9
10
def create_warrior
0 commit comments