Erin Call

Erin Call

You Can't Spell Engineering Without Erin

Posts tagged ruby

Alternative Ways To Rescue In Ruby


If you've worked in Ruby much, you're probably familiar with using begin/rescue/end to catch exceptions. Did you know there are other ways to use rescue? It's true! You may be able to delete a bit of software by using inline or implicit rescues.

(Read the full post...)

Posted on 2014-09-11T18:00:00Z
Posted in ruby, software deleter.

Regular Expressions

My friend Shawna Scott encountered a need for regular expressions for the first time recently. I went to link her to some information, but I couldn't find a single introduction online that satisfied me. That lack seems disastrous. Regular Expressions are so important that every major programming language provides an engine for executing them, and many embed that engine directly into the parent language's syntax. They're inescapable--yet no tutorial measures up. Let's see what I can do, shall we?

(Read the full post...)

Posted on 2013-10-12T06:37:00Z
Posted in ruby, regular expressions.

Ruby Blocks Are Way More Complicated Than You Think

I've been working with Ruby a lot lately, and it's impossible to do that very much without noticing how feature-rich the language is. Today I journeyed deep into the strange and wonderful world of blocks. Blocks are used heavily in Ruby, and although they look like the simple anonymous functions I'm used to in JavaScript, their semantics are significantly more sophisticated. Most relevant to us today is that a function that receives a block doesn't take it as an explicit parameter. Instead, it checks block_given? to see if the caller provided a block.

(Read the full post...)

Posted on 2012-11-22T05:42:00Z
Posted in ruby.