Created
October 24, 2018 10:58
-
-
Save Marahin/52e8b2aed6469446767c66476298fc1a to your computer and use it in GitHub Desktop.
Fridge contents are awesome
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 fridge_1_contents | |
@fridge_1_contents ||= [1].freeze | |
end | |
def fridge_2_contents | |
@frigde_2_contents ||= [2].freeze | |
end | |
fridge_3_contents = fridge_1_contents + fridge_2_contents | |
=> [1, 2] | |
fridge_3_contents.frozen? | |
=> false | |
fridge_1_contents.frozen? | |
=> true | |
fridge_2_contents.frozen? | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment