Last active
April 8, 2017 21:14
-
-
Save kklimuk/e3b2c58aaf0de500403520e86c71ddc9 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
def users_with_discounts | |
@users_with_discounts ||= {} | |
if @users_with_discounts.has_key?(:return_value) | |
@users_with_discounts[:return_value] | |
else | |
@users_with_discounts[:return_value] = computation_that_returns_nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment