Ten Things You Didn't Know You Could Do
summary
Forty two concrete Ruby tricks appear and many are demonstrated working live such as 42 tricks rather than ten, enabling tail call optimization to make deep recursion feasible, using spawn with PID and IO redirection to control subprocesses, reading URLs via open-uri, getting cryptographic bytes from SecureRandom, using Hash#fetch to fail fast, ARGF and the flip flop operator to slice files, unpacking PNG headers to read width and height, and using Enumerator chaining and each_with_object for clearer iteration.
AI-written summary · about
chapters (17)
- 0:00Start
- 4:58View the Machine Instructions
- 5:39Tail Call Optimization
- 12:07Dodging a Warning
- 12:38Shortcut Variable Interpolation
- 14:38Associative Arrays
- 15:45Easy, Fast Memoization
- 16:33Rolling Your Own Dispatch Table
- 22:12Chaining Iterators
- 23:44Programmatically Build Classes
- 24:03Programmatically Build Modules
- 24:50Subclass Module
- 28:03Profile the Garbage Collector
- 29:54The SDEBUG Flag
- 33:00Get Random Data
- 34:29Template Methods
- 37:06Mini Ruby Programs








