Skip to content

Instantly share code, notes, and snippets.

@LTe
Created February 10, 2012 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LTe/1789028 to your computer and use it in GitHub Desktop.
Save LTe/1789028 to your computer and use it in GitHub Desktop.
@cache = {}
@cache["test"] = "resource"
def my_method
return value=value if value = @cache["test"]
end
puts my_method # => resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment