Process::Results::Holder - methods for objects that hold Process::Results objects.
package MyClass; use strict; use base 'Process::Results::Holder'; my $object = MyClass->new my $results = MyClass->results; $object->error('error-id')
It's often convenient for an object to hold a Process::Results object. Process::Results::Holder provides methods for handling a contained results object. To add these methods to your class, simply extend Process::Results::Holder:
use base 'Process::Results::Holder';
The methods that are added to your class assume that you have or will put a results object in the 'results' property of the object.
results() returns the Process::Results object that is held by the holder.
results()
$results = $object->results();
If the results object exists in the 'results' property:
$object->{'results'}
then it is returned. If it does not exist, then one is created, stored in the 'results' object, then returned.
These methods do that same thing as their Process::Results counterparts: they store messages in the results object. If the results object doesn't exist, it is created.
This method returns the class name to use to create the results object. By default it returns 'Process::Results'. Override this class if you would like to use a custom results class.
Copyright (c) 2016 by Miko O'Sullivan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This software comes with NO WARRANTY of any kind.
Miko O'Sullivan miko@idocs.com
Version: 0.01
Version 0.02 Aug 15, 2016
Adding Process::Results::Holder to Process::Results.
To install Process::Results, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Process::Results
CPAN shell
perl -MCPAN -e shell install Process::Results
For more information on module installation, please visit the detailed CPAN module installation guide.