Chapter 21. Use method_missing for Flexible Error Handling

My car worries too much. Well it’s not the whole car, it’s just the little embedded computer that lurks behind the door locks. That little processor seems to live in dread that I might someday accidentally leave my car unlocked. Thus, it devotes its whole being to making sure that no door stays unlocked for too long. I’m usually OK if I unlock the car and jump right in. But woe to me if I unlock the car and get a phone call. The time it takes to look at my cell phone to see who’s calling is apparently too long by the exacting standards of Toyota, and the doors relock. They’ll also lock in the time it takes to throw some groceries into the trunk. Or to kiss my wife goodbye. There have ...

Get Eloquent Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.