Platypus is a small inter-related collection of type-oriented libraries for Ruby. Among it's quacking talents is a type casting system, a pseudo-type superclass and a method overloading mixin.


Platypus is a project about types. Its three libraries addresses usecases for object types that are more nuanced than stock Ruby's provisions. It's not uncommon for a Rubyist, especially some new to Ruby, to wonder about method-overloading, or complex type checking, or why type conversion isn't more generalized. And I dare say, it is not without good reason. These constructs are rather intuitive and not without their merits. However, mature Rubyists tend to forgo such niceties when weighed against the disadvantages of YADSL and having an additional package dependency. Your mileage may of course vary. If you are still keen after making such considerations, or would just like to learn how such features can be implemented via Ruby's amazing metaprogramming capabilities, then the Platypus is here for the riding, with fairly mature implementations that have evolved over the years.

Hi.. Ho.. Silver! Away!

"I know Why said you are a Duck.
But I'm betting it's a Type Error.
You ride like a thoroughbred

"If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands."

--Douglas Adams

Copyright © 2010 Thomas Sawyer · Image of "Horse on Duck" by WhyTheLuckyStiff (God Speed, Eigenman).