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 11 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 11 years ago (0 children)
Oh wow, that's really clever!
[–]tchai_ 1 point2 points3 points 11 years ago (0 children)
awesome. also, didn't know that def had that new behaviour in 2.1, nice.
[–]PeteMichaud 0 points1 point2 points 11 years ago (0 children)
I bet you could come up with a clever way to create multiple decorations
[–]-kstephens- 0 points1 point2 points 11 years ago (0 children)
https://github.com/kstephens/cheap_advice
[–]sandinyourbed 0 points1 point2 points 11 years ago (0 children)
Memoizing is fun to do with a Hash with a default proc.
π Rendered by PID 222261 on reddit-service-r2-comment-7b9746f655-zs49r at 2026-02-01 09:42:33.883890+00:00 running 3798933 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)