Last active
August 29, 2015 14:01
-
-
Save teamon/6c82cf686291e61bc2fc to your computer and use it in GitHub Desktop.
Ruby 2.1 method return value use cases
This file contains hidden or 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
private def foo # make one method private | |
instrumet def foo # calculates execution time | |
silent def foo # silences stdout/err output | |
cached def foo(args...) # caches each invokation with different arguments into redis | |
memoize def foo # memoizes return value in instance variable | |
async def foo # executes method in new thread and return thread object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment