Newer arrivals to Ruby sometimes wonder when to use #each, and when to use 'for'. Today, a detailed explanation of how they differ, and an opinion on when to use …
Month: January 2014
Episode #172: Registry
Today's dish is another one from one of my favorite cookbooks: Martin Fowler's Patterns of Enterprise Application Development. This time, we'll use the Registry pattern to make it easy for …
Episode #171: puts
Even the most basic of Ruby methods sometimes have hidden depth. Today we'll take a look at some advanced uses of the puts method.
Episode #170: Hash Merge
Today's episode covers an incredibly handy capability of Ruby's hashes that I didn't know about until recently.
Episode #169: Caching Gateway
You might remember the Gateway and Mapper patterns from recent episodes. Today we'll look at how to insert a caching layer between those two patterns. In the process, we'll examine …
Episode #168: Enumerable Internals
In this very special episode, guest chef Pat Shaughnessy takes us on a whirlwind tour of the Ruby internals that make the Enumerable#all? method tick.
Episode #167: Debugging in Gems
When debugging a tricky problem, don't you sometimes wish you could just drop a line of debugging code right in the middle of a third-party gem? This episode shows how …
Episode #166: Not Implemented
Ruby doesn't have a built-in concept of "abstract" classes, but sometimes we want a way to show other programmers when methods are left as an exercise for the implementor. This …
Episode #165: Refactor Tapas::Queue
In previous episodes, we got the Tapas::Queue class under test, using a couple of different thread-testing techniques. Now that it has tests, it's time to refactor. The steps of this …