This example expands upon the Example::Types library defined in Type::Tiny::Manual::Libraries. It defines class types for DateTime and DateTime::Duration and some structured types for hashes that can be used to instantiate DateTime objects. It defines some coercions for the Datetime class type.
A simple Moose class is provided using some of these types and coercions. The class also defines a couple of extra coercions inline.
See the source code of this file for the actual example code.
Toby Inkster <email@example.com>.
This software is copyright (c) 2013 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Type::Tiny, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.