The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Statocles::Types - Type constraints and coercions for Statocles

VERSION

version 0.054

SYNOPSIS

    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,
    );

DESCRIPTION

This is a type library for common Statocles types.

TYPES

Store

An object that consumes the Statocles::Store role.

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 coersion creates a Staticles::Store::File object.

Theme

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.

LinkArray

An arrayref of Statocles::Link objects.

This can be coerced from any ArrayRef of HashRefs.

LinkHash

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.

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 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.