Skip to content

Instantly share code, notes, and snippets.

@JacobEvelyn
Last active June 30, 2021 14:45
Show Gist options
  • Save JacobEvelyn/fba69b7c59f367910485082efe03e5c5 to your computer and use it in GitHub Desktop.
Save JacobEvelyn/fba69b7c59f367910485082efe03e5c5 to your computer and use it in GitHub Desktop.
||= Ruby memoization
class Example
def slow_value
@slow_value ||= begin
...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment