As our series on representing physical quantities draws to a close, we turn our attention to existing libraries, specifically the Unitwise gem.
It's often desirable compare objects to see which is "lesser" or "greater"; but not all objects are inherently comparable. Today we'll look at a scheme for easily imposing an arbitrary …
In episode 205 we introduced the spaceship (<=>) operator, but we also introduced an incompatibility with how Ruby's builtin comparisons work. Today we'll address this oversight.
In this episode we meet a Ruby standard module that makes it easy to make classes comparable and sortable.
Building on the previous episode on hash tables, today we tackle the concept of hash equality: how Ruby decides if two objects are the same for the purpose of use …
Today's dish is an exploration of how Ruby is able to quickly look up keys in hashes.
Today's episode demonstrates a technique for speeding up the process of sorting some collections.
Today's episode covers an incredibly handy capability of Ruby's hashes that I didn't know about until recently.
In this very special episode, guest chef Pat Shaughnessy takes us on a whirlwind tour of the Ruby internals that make the Enumerable#all? method tick.