Statocles::Types - Type constraints and coercions for Statocles
version 0.085
use Statocles::Class; use Statocles::Types qw( :all ); has store => ( isa => Store, coerce => Store->coercion, ); has theme => ( isa => Theme, coerce => Theme->coercion, ); has link => ( isa => Link, coerce => Link->coercion, ); has links => ( isa => LinkArray, coerce => LinkArray->coercion, ); has nav => ( isa => LinkHash, coerce => LinkHash->coercion, ); has date => ( isa => DateTimeObj, coerce => DateTimeObj->coercion, );
This is a type library for common Statocles types.
A Statocles::Store object.
This can be coerced from any Path::Tiny object or any String, which will be used as the filesystem path to the store's documents (the path attribute). The coercion creates a Statocles::Store object.
A Statocles::Theme object.
This can be coerced from any Path::Tiny object or any String, which will be used as the store attribute (which will then be given to the Store's path attribute).
A Statocles::Link object.
This can be coerced from any HashRef.
An arrayref of Statocles::Link objects.
This can be coerced from any ArrayRef of HashRefs.
A hashref of arrayrefs of Statocles::Link objects. Useful for the named links like site navigation.
This can be coerced from any HashRef of ArrayRef of HashRefs.
A DateTime::Moonpig object representing a date/time. This can be coerced from a YYYY-MM-DD string or a YYYY-MM-DD HH:MM:SS string.
YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2016 by Doug Bell.
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 Statocles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Statocles
CPAN shell
perl -MCPAN -e shell install Statocles
For more information on module installation, please visit the detailed CPAN module installation guide.