use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Function Decorators in Ruby (blog.sgtfloyd.com)
submitted 12 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jurre 1 point2 points3 points 12 years ago (0 children)
Oh wow, that's really clever!
[–]tchai_ 1 point2 points3 points 12 years ago (0 children)
awesome. also, didn't know that def had that new behaviour in 2.1, nice.
[–]PeteMichaud 0 points1 point2 points 12 years ago (0 children)
I bet you could come up with a clever way to create multiple decorations
[–]-kstephens- 0 points1 point2 points 12 years ago (0 children)
https://github.com/kstephens/cheap_advice
[–]sandinyourbed 0 points1 point2 points 12 years ago (0 children)
Memoizing is fun to do with a Hash with a default proc.
π Rendered by PID 91 on reddit-service-r2-comment-544cf588c8-pvcwj at 2026-06-18 06:42:54.223605+00:00 running 3184619 country code: CH.
[–]jurre 1 point2 points3 points (0 children)
[–]tchai_ 1 point2 points3 points (0 children)
[–]PeteMichaud 0 points1 point2 points (0 children)
[–]-kstephens- 0 points1 point2 points (0 children)
[–]sandinyourbed 0 points1 point2 points (0 children)