Category Archives: Ruby

RubyTapas Freebie: Streaming

Does code optimized for RAM usage need to be ugly? Find out, in this free episode of RubyTapas.

Posted in Ruby, RubyTapas Samples, Screencasts | 5 Comments

RubyTapas Freebie: Scanning a String

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , , | 4 Comments

RubyTapas Freebie: Caller-Specified Fallback Handler

Sometimes it’s hard to decide how to handle a failure in a method call. Raise an exception? Return a nil? Log an error? The best choice may differ depending on where the method is being called. In today’s free RubyTapas … Continue reading

Posted in Ruby, RubyTapas Samples, Screencasts | 3 Comments

RubyTapas Freebie: Blocks, Procs, & Lambdas

It’s been way too long since I posted a Monday freebie. Today’s little video tries to answer a question I hear pretty often: what’s the difference between blocks, procs, and lambdas—and which one should I use?

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , | 3 Comments

Modeling the World with Prototypes

This post started out as the second half of an article on prototype-based OO design for Gregory Brown’s Practicing Ruby. For an introduction to the prototyped view of the object world, and to follow along on an adventure in making … Continue reading

Posted in Design, Ruby | Tagged , , , | 10 Comments

RubyTapas 033: Classes and Constants

This week’s freebie episode is a brief exploration of what exactly happens when we define a class in Ruby. [http://www.youtube.com/watch?v=p61mk_O4Tw0]

Posted in Ruby, RubyTapas Samples, Screencasts | Leave a comment

RubyTapas 029 – Redirecting Output

Today’s Monday freebie takes a look at two different methods for redirecting standard out and standard error – one simple and quick, one more comprehensive.

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , | Leave a comment

RubyTapas 027: Macros and Modules

In this episode themed after a certain sci-fi television series with the initials “BSG”, we take a look at how to use dynamically generated modules to make metaprogrammed methods open for future extension. This is a two-parter. In part two, (which … Continue reading

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , , , | 6 Comments

RubyTapas 022: Inline Rescue

Sticking a rescue at the end of a line may seem expedient, but it has a tendency to bite you when you least expect it. In today’s freebie episode, I demonstrate how dangerous an inline rescue can be, as well … Continue reading

Posted in Ruby, RubyTapas Samples, Screencasts | Tagged , | 1 Comment

RubyTapas Episode 21: Domain Model Events

Today’s free Monday episode features a rare delving into Rails code. We take a look at a fat controller, and thin it down by identifying the model lifecycle events that are hiding inside it. This episode garnered a lot of … Continue reading

Posted in Rails, Ruby, RubyTapas Samples, Screencasts | 4 Comments