Alexei Znamensky > DataFlow-1.121830 > DataFlow::Item

Download:
DataFlow-1.121830.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  12
Open  1
View/Report Bugs
Module Version: 1.121830   Source  

NAME ^

DataFlow::Item - A wrapper around the regular data processed by DataFlow

VERSION ^

version 1.121830

SYNOPSIS ^

    use DataFlow::Item;
        my $item = DataFlow::Item->itemize( 'channel_name', 42 );
        say $item->get_data( 'channel_name' );

        $item->set_metadata( 'somekey', q{some meta value} );
        say item->get_metadata( 'somekey' );

DESCRIPTION ^

Wraps data and metadata for processing through DataFlow.

ATTRIBUTES ^

metadata

A hash reference containing metada for the DataFlow.

channels

A hash reference containing data for each 'channel'.

METHODS ^

metakeys

A convenience method that returns the list of the keys to the metadata hash reference.

channel_list

A convenience method that returns the list of the keys to the channels hash reference.

get_metadata

Returns a metadata value, identified by its key.

set_metadata

Sets a metadata value, identified by its key.

get_data

Returns a channel value, identified by the channel name.

set_data

Sets a channel value, identified by the channel name.

itemize

This is a class method that creates a new DataFlow::Item with a certain data stored in a specific channel. As a class method, it must be called like this:

        my $item = DataFlow::Item->itemize( 'channel1', { my => data } );

clone

Makes a copy of the DataFlow::Item object. Note that the whole metadata contents (hash reference, really) is passed by reference to the new instance, while the contents of the channels are copied one by one into the new object.

narrow

Makes a copy of the DataFlow::Item object narrowed to one single channel. In other words, it is like clone, but the channels will contain only the channel specified as a parameter.

SEE ALSO ^

Please see those modules/websites for more information related to this module.

AUTHOR ^

Alexei Znamensky <russoz@cpan.org>

COPYRIGHT AND LICENSE ^

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.

BUGS AND LIMITATIONS ^

You can make new bug reports, and view existing ones, through the web interface at http://rt.cpan.org.

DISCLAIMER OF WARRANTY ^

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.

syntax highlighting: