« blib/lib/Set/Associate/NewKey/RandomPick.pm
↑ Summary
blib/lib/Set/Associate/RefillItems/Shuffle.pm »
| 1 | use 5.006; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package Set::Associate::RefillItems::Linear; | ||
| 6 | |||
| 7 | # ABSTRACT: a refill method that replenishes the cache with a repeating set of items | ||
| 8 | |||
| 9 | our $VERSION = '0.004000'; | ||
| 10 | |||
| 11 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
| 12 | |||
| 13 | use Moose qw( with has ); | ||
| 14 | |||
| 15 | with 'Set::Associate::Role::RefillItems' => { can_get_all => 1 }; | ||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | has items => ( isa => 'ArrayRef', is => 'rw', required => 1 ); | ||
| 26 | |||
| 27 | __PACKAGE__->meta->make_immutable; | ||
| 28 | |||
| 29 | no Moose; | ||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | sub name { 'linear' } | ||
| 38 | |||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | sub get_all { return @{ $_[0]->items } } | ||
| 46 | |||
| 47 | 1; | ||
| 48 | |||
| 49 | __END__ | ||
| 50 | |||
| 51 | =pod | ||
| 52 | |||
| 53 | =encoding UTF-8 | ||
| 54 | |||
| 55 | =head1 NAME | ||
| 56 | |||
| 57 | Set::Associate::RefillItems::Linear - a refill method that replenishes the cache with a repeating set of items | ||
| 58 | |||
| 59 | =head1 VERSION | ||
| 60 | |||
| 61 | version 0.004000 | ||
| 62 | |||
| 63 | =head1 CONSTRUCTOR ARGUMENTS | ||
| 64 | |||
| 65 | =head2 items | ||
| 66 | |||
| 67 | required ArrayRef | ||
| 68 | |||
| 69 | =head1 METHODS | ||
| 70 | |||
| 71 | =head2 name | ||
| 72 | |||
| 73 | The name of this refill method ( C<linear> ) | ||
| 74 | |||
| 75 | =head2 get_all | ||
| 76 | |||
| 77 | Get a new copy of L</items>. | ||
| 78 | |||
| 79 | =head1 ATTRIBUTES | ||
| 80 | |||
| 81 | =head2 items | ||
| 82 | |||
| 83 | =head1 AUTHOR | ||
| 84 | |||
| 85 | Kent Fredric <kentnl@cpan.org> | ||
| 86 | |||
| 87 | =head1 COPYRIGHT AND LICENSE | ||
| 88 | |||
| 89 | This software is copyright (c) 2015 by Kent Fredric <kentfredric@gmail.com>. | ||
| 90 | |||
| 91 | This is free software; you can redistribute it and/or modify it under | ||
| 92 | the same terms as the Perl 5 programming language system itself. | ||
| 93 | |||
| 94 | =cut |