ruby notes

Small things I keep relearning about Ruby.

Living with frozen string literals

What actually breaks when you flip the magic comment on an old codebase, and the two-line fix for most of it.

When lazy is worth it

Lazy enumerators are not free. A quick look at where they save memory and where they just add overhead.

Pattern matching on hashes

Using case/in to replace a pile of dig calls when parsing JSON from a flaky API.