Integer Formats

Sometimes using a string format is overkill. Today we look at quick and easy ways to convert to and from hexadecimal, octal, binary, and other integer…

Conversion Protocol

Today's topic is "conversion protocols", an extensible way to enable safe, automatic conversions between types.

Implicit Conversion

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…

Explicit Conversion

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 …

Lenient Conversions

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 ep…

Conversion Function

In this episode we create a function for converting arbitrary values into Feet objects.