ruby-tricks
The most part of those Ruby Tricks were extracted from James Edward Gray II talk. If you know some other ruby-trick, please contribute!
Associative Arrays
Autovivification
Blocks can take blocks
Bubbling up thread errors
Case on ranges
Count all objects
Cycle
DATA
Easiest Database store
Easiest Database Pstore using yams
Enable ruby warnings
Fast memoization - fibonacci
Fetch data
Get Random Data
Inject
Inspecting the source with script lines
Iterating over specific types
Lambda your own syntax
Print formatted with debug
Ruby can even explain it to you
Ruby debug flag
Shortcut variable interpolation
Single instance running
Struct without assignment
Super Magic keyword
Super Magic keyword 2
Super Magic keyword 3
Super Magic keyword 4
Super Magic keyword 5
Tail Call
Trigger IRB as needed
Turn on garbage collector
Unused variable format
Variables from a regex
Zip
Contributing
- Fork it
- Create your trick branch:
git checkout -b my-ruby-trick
- Commit your changes:
git commit -am 'Add trick'
- Push to the branch:
git push origin my-new-trick
- Create new Pull Request and explain a little bit about your ruby trick