Module Wrest::Components::Container::Typecaster

  1. lib/wrest/components/container/typecaster.rb

An extension to Container that adds support for specifying how the values associated with certain attribute keys should be typecast.

This extension can be used in situations where the attributes hash consists of just strings with no associated tup information. For example, params recieved from a web browser may contain attributes like

'id' => '4', 'dateofbirth' => '1984-04-05'

and we’d like to have these cast to an integer and a date respectively, rather than have to deal with them as strings.

Included modules

  1. Typecaster::InstanceMethods