In today's episode, we explore a practical application of the famous "tell, don't ask" principle.
Today we look at Ruby's grep method, and explore the idea of matching objects by example.
Today we puzzle through a design problem that threatens to result in dozens of extra methods.
Today's topic is "conversion protocols", an extensible way to enable safe, automatic conversions between types.
Today's episode deals with a small matter of style, one that can have an impact on how easy it is to refactor code.
The distinction between "public" and "private" method visibility in Ruby is pretty obvious. But when should we use "protected" visibility? This episode attempts to answer that question.
Have you ever wondered why Ruby has both #to_i and #to_int methods? Or both #to_a and #to_ary? In today's episode we'll answer this question, and look at how we can …
In this episode we look at how to convert our Feet objects back to core numeric types. In the process, we gain the ability to use our Feet objects in …
For core types like Float, Ruby has both conversion methods (#to_f), and conversion functions (Float()). When should we use one vs. the other? This episode attempts to answer that question.