Skip to content

Instantly share code, notes, and snippets.

@superscott
Last active August 29, 2015 14:02
Show Gist options
  • Save superscott/a02c0c59bdeb5f857683 to your computer and use it in GitHub Desktop.
Save superscott/a02c0c59bdeb5f857683 to your computer and use it in GitHub Desktop.
@cache ||= begin
return true if condition1 && condition2
return true if condition3
return true if condition4
long_code1
long_code2
long_code3
result2
end
unless @cache.present?
return if condition1_2
return if condition3
return if condition4
end
def condition1_2
if condition1 && condition2
@cache = true
true
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment