
Coat::Types -- Type constraints handling for Coat

Attributes in Coat are bound to types with the keyword 'isa'. This lets Coat perform type-constraint validation when a value is set to an attribute of the class.
The following types are supported by Coat (based on the ones provided by Moose, those that are not available in Moose are marked 'C')
Any
Item
Bool
Undef
Defined
Value
Num
Int
Timestamp (C)
Str
ClassName
Ref
ScalarRef
ArrayRef
HashRef
CodeRef
Each of these types provides a static method called "is_valid" which takes a value and returns a boolean telling if the value given is valid according to the type.

This module provides a method for validating a value set to an attribute. It calls the appropriate "is_valid" method according to the type given.
If the type given is not a known type, it will be assumed this is a classname, and the value will then be checked with ClassName->is_valid.

See Coat for more details.

This module was written by Alexis Sukrieh <sukria+perl@sukria.net>

Copyright 2007 by Alexis Sukrieh.
http://www.sukria.net/perl/coat/
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.