Nicholas Perez

NAME

Document::Transform::Transformer - A document transformer. More than meets the eye. Or not.

VERSION

version 1.110530

SYNOPSIS

    use Document::Transform::Transformer;
    use MyTypeLib(':all');

    my $transformer = Document::Transform::Transformer->new
    (
        document_constraint => Document,
        transform_constraint => Transform,
    );
    my $altered = $transformer->transform($document, $transforms);

DESCRIPTION

Need a simple transformer that mashes up a transform and a document into something awesome? This is your module then.

This is the default for Document::Transformer to use. It expects data structures that align with whatever type constraints are passed into the constructor that represent a Document and a Transform. It implements the interface role Document::Transform::Role::Transformer

PUBLIC_ATTRIBUTES

document_constraint

    is: ro, isa: Moose::Meta::TypeConstraint, required: 1

The default Transformer must have the constraints supplied to it via constructor. This constraint should check for whatever is a valid Document for the backend.

transform_constraint

    is: ro, isa: Moose::Meta::TypeConstraint, required: 1

The default Transformer must have the constraints supplied to it via constructor. This constraint should check for whatever is a valid Transform for the backend.

PUBLIC_METHODS

transform

    (Document, ArrayRef[Transform])

transform takes a Document and an array of Transforms and performs the operations contained with the transforms against the document. Returns the transformed document.

The type constraints for Document and Transform are stored in the attributes "document_constraint" and "transform_constraint", respectively.

AUTHOR

Nicholas R. Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Infinity Interactive.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.