Set::Associate::RefillItems - Pool re-population methods
version 0.004001
This class implements a generalized interface for creating objects which populate pools.
What you're mostly interested in are "CLASS METHODS", which are shorthand (somewhat) for loading and constructing many of the Set::Associate::RefillItems::* family.
Set::Associate::RefillItems::*
However, if your code needs to design its own version on the fly, this interface should work:
my $populator = Set::Associate::RefillItems->new( name => 'foo', items => [ .... ], code => sub { my ( $self, $sa ) = @_; .... }, ); my $sa = Set::Associate->new( on_item_empty => $populator , ... );
required Str
required CodeRef
required ArrayRef
Populate from items each time.
items
See Set::Associate::RefillItems::Linear for details.
Set::Associate::RefillItems::Linear
my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems->linear( items => [ ... ]) );
or ...
use Set::Associate::RefillItems::Linear; my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems::Linear->new( items => [ ... ]) );
Populate with a shuffled version of items
See Set::Associate::RefillItems::Shuffle for details.
Set::Associate::RefillItems::Shuffle
my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems->shuffle( items => [ ... ]); );
use Set::Associate::RefillItems::Shuffle; my $sa = Set::Associate->new( ... on_items_empty => Set::Associate::RefillItems::Shuffle->new( items => [ ... ]) );
Invokes Trait:Code/execute_method on "code"
Trait:Code/execute_method
Predicate method for "items"
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Set::Associate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Set::Associate
CPAN shell
perl -MCPAN -e shell install Set::Associate
For more information on module installation, please visit the detailed CPAN module installation guide.