Salvation::MacroProcessor::Iterator - An iterator for reading query results
Salvation::MacroProcessor::Iterator is an iterator class. It should be wrapped around your custom iterator and supplied some postfiltering function which will execute Salvation::MacroProcessor::MethodDescription::postfitler routine.
postfilter
::postfitler
my $it = Salvation::MacroProcessor::Iterator -> new( postfilter => $CodeRef, iterator => $it );
Moose
Salvation::MacroProcessor::Iterator -> new( postfilter => $CodeRef, iterator => $it )
Constructor.
Returns Salvation::MacroProcessor::Iterator instance.
Arguments:
A CodeRef matching following signature:
( Any $object )
. $object is an object representing a single row of data returned by the query.
$object
$CodeRef function will be executed for each row to check if this row is suitable as a result for caller, or not.
$CodeRef
Boolean value should be returned, false means "skip this object" and true means "yes, this object is what we want".
false
true
It is common to make $CodeRef look like that:
sub { $spec -> __postfilter_each( shift ) }
, where $spec is a Salvation::MacroProcessor::Spec instance.
$spec
An Object that does Salvation::MacroProcessor::Iterator::Compliance role.
Salvation::MacroProcessor::Iterator will be wrapped around this object.
$object -> first()
Returns first element of a list.
$object -> last()
Returns last element of a list.
$object -> next()
Returns element at current position, then increases position by one.
$object -> prev()
Returns element at current position, then decreases position by one.
To install Salvation::MacroProcessor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Salvation::MacroProcessor
CPAN shell
perl -MCPAN -e shell install Salvation::MacroProcessor
For more information on module installation, please visit the detailed CPAN module installation guide.