A Ruby Conversion Idiom

@CapnKernul writes: [do you know of] a Ruby idiom for converting an object to a type if it isn’t already that type. For example, if you want to only store an attribute of type Foo, you could write an accessor method that would pass any non-Foo object to Foo’s constructor. There is a de facto […]