dam5s/happymapper — pull request #31 by burtlo (2013-02-12 06:26:42+00:00)
Title: Refactor typecast

Previously our `Item#typecast` method was a bit of nightmarish looking.

This refactoring attempt is to start creating a system where we can define typecast conversions if we so desire.

Right now you register types with the `HappyMapper::SupportedTypes.register` or `HappyMapper::SupportedTypes.register_type` method. They are added to the `HappyMapper::SupportedTypes.types` array. These are executed in order to see which one applies. When one matches it is executed.

It is easy for developers to add new typecasters but that is not so for developers that want to modify existing typecasters. I am open for suggestions on how a user might replace one of these typecasters.