In today's episode, we'll compare two methods for getting to the body of an email: one imperative; one functional; and both idiomatic Ruby.
Tag: iteration
Episode #173: For
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 …
Episode #128: Enumerable Queue
Queue, somewhat surprisingly, is not enumerable. Which is all the excuse we need to have some more fun with the Enumerator class, in today's episode.
Episode #110: Catch And Throw
A refactoring episode, showing how to replace exceptions-as-flow-control with the "catch" and "throw" methods.
Episode #073: Tail Part 2: Do While
As we continue to rewrite a subset of the UNIX tail(1) command, we learn how to write a do...while loop in Ruby.
Episode #064: Yield or Enumerate
A number of Ruby standard library methods return an Enumerator if no block is passed to them. In this episode, we'll learn how to emulate this behavior in our own …
Episode #060: Ascend
Now that we've been formally introduced to the Enumerator class, it's time to apply that knowledge in a concrete way. In this episode we use Pathname and Enumerator to locate …
Episode #059: Enumerator
In previous episodes we've touched on Enumerator in passing. This time it'll take center stage, as we explore just what an Enumerator is and what it's good for.