DataFlow::Types - Type definitions for DataFlow
version 1.121690
When defining a Moose attribute. Example:
has 'direction' => ( is => 'ro', isa => 'ConversionDirection', );
This module contains only type definitions. Most of the time there will be no need to work or mess with this code, unless there is a bug in DataFlow and/or you are developing a new feature which requires a new type or an adjustment to an existing one.
A DataFlow::Proc object, with coercions.
Named processors. If it contains the substring '::', DataFlow will try to create an object of that type. If it does not, then DataFlow will attempt to create an object of the type DataFlow::Proc::<STRING>. The string 'Proc' is reserved for creating an object of the type <DataFlow::Proc>.
DataFlow::Proc::<STRING>
Named processor with parameters. The first element of the array must be a text string, subject to the rules used in the previous item. The rest of the array is passed as-is for the constructor of the object.
Code reference, a.k.a. a sub. A processor object will be created:
sub
DataFlow::Proc->new( p => CODE )
An object that can process something. Objects from both DataFlow and DataFlow::Proc classes will consume that role, so will all its descendants. If the element is blessed and ->does('DataFlow::Role::Processor'), a processor object will be created wrapping it:
->does('DataFlow::Role::Processor')
DataFlow::Proc->new( p => sub { PROCESSOR->process($_) } )
An ArrayRef of DataFlow::Role::Processor objects, with at least one element.
Attempts to make DataFlow::Role::Processor objects out of different things provided in an ArrayRef. It currently works for:
DataFlow::Role::Processor
Str
ArrayRef
CodeRef
using the same rules as in the subtype Processor described above. Anything else will trigger an error.
Processor
An ArrayRef will be created wrapping a named processor, as described in the coercion section of the Processor subtype above.
An ArrayRef will be created wrapping a processor, as described in the coercion section of the Processor subtype above.
An ArrayRef will be created wrapping the processor, as described in the coercion section of the Processor subtype above.
An ArrayRef of DataFlow::ProcWrapper objects, with at least one element.
Attempts to make DataFlow::ProcWrapper objects out of different things provided in an ArrayRef. It currently works for:
DataFlow::ProcWrapper
using the same rules as in the subtype Processor described above and wrapping the resulting Processor in a DataFlow::ProcWrapper object. Anything else will trigger an error.
An ArrayRef will be created wrapping a named processor, as described in the coercion section of the Processor subtype above and wrapping the resulting Processor in a DataFlow::ProcWrapper object.
An ArrayRef will be created wrapping a processor, as described in the coercion section of the Processor subtype above and wrapping the resulting Processor in a DataFlow::ProcWrapper object.
An ArrayRef will be created wrapping the processor, as described in the coercion section of the Processor subtype above and wrapping the resulting Processor in a DataFlow::ProcWrapper object.
A CodeRef, with coercions.
An ArrayRef will be created wrapping the processor. The rules used above for DataFlow::Role::Processor elements in the ArrayRef apply.
An enumeration used by type DataFlow::Proc::Converter, containing two elements:
CONVERT_TO
Indicates the conversion will occur towards a specified type
CONVERT_FROM
Conversely, indicates the conversion will occur from a specfied type
See DataFlow::Proc::Converter for more information.
A HashRef[CodeRef] also used by DataFlow::Proc::Converter. It must have two keys only, 'CONVERT_TO' and 'CONVERT_FROM', holding a code reference (sub) for each of those.
A CodeRef used by DataFlow::Proc::Encoding. It will be used to decode strings from some particular character encoding to Perl's internal representation.
It will automagically create a sub that uses function decode() from module Encode to decode from a named encoding.
decode()
A CodeRef used by DataFlow::Proc::Encoding. It will be used to encode strings from Perl's internal representation to some particular character encoding.
It will automagically create a sub that uses function encode() from module Encode to encode to a named encoding.
encode()
Please see those modules/websites for more information related to this module.
DataFlow
Alexei Znamensky <russoz@cpan.org>
This software is copyright (c) 2011 by Alexei Znamensky.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
You can make new bug reports, and view existing ones, through the web interface at http://rt.cpan.org.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install DataFlow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DataFlow
CPAN shell
perl -MCPAN -e shell install DataFlow
For more information on module installation, please visit the detailed CPAN module installation guide.