Ruby gives as a number of options when it comes to defining class methods. This episode starts by demonstrating three of them, and then gets a bit opinionated.
The DRY principle teaches us to get rid of duplication wherever we find it. But not all duplication is created equal...
In this continuation of the Gem-Love project, I complete the end-to-end acceptance test, verifying that the client can talk to the server. Source code here: https://github.com/avdi/gem-love/tree/rubytapas-088 Just a reminder, I'm collecting …
Naming things is hard, and it's difficult to come up with hard-and-fast rules for it. But it can be helpful to learn from examples of real-world naming decisions that led …
In this episode we tackle how to override base class methods while cleanly passing through multiple base-class arguments. Notes: Paul Battley on Destructuring Assignment in Ruby
Sometimes a block or method may receive arguments that you just don't care about. This episode introduces the idiomatic Ruby way to indicate that certain arguments should be ignored.
Today we take a look at a related feature to Ruby's "splat" operator: the ability to recursively destructure arrays using grouped assignment.
In today's episode we discover how to make an arbitrary object implicitly "splat"-able.
It's a small thing, but judicious use of inline assignment can make code more DRY and concise. In this episode we look at how to do it, and when.
Delving further into Ruby's destructuring assignment, or "splat", mechanism, today we look at some cases where Ruby performs splatting without an explicit '*' operator.