Skip to content

Commit 3e0a127

Browse files
Hermann Laghom TallaHermann Laghom Talla
authored andcommitted
Add Memoization syntax in proxy pattern snippet
1 parent 8bb2148 commit 3e0a127

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)