Skip to content

Commit 1401f18

Browse files
authored
Merge pull request #29 from maniodev/add-memoization-syntax
Add Memoization syntax in proxy pattern snippet
2 parents 8bb2148 + 3e0a127 commit 1401f18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proxy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class VirtualAccountProxy
8888
end
8989

9090
def subject
91-
@subject || (@subject = BankAccount.new(@starting_balance))
91+
@subject ||= BankAccount.new(@starting_balance)
9292
end
9393
end
9494
```

0 commit comments

Comments
 (0)