| 1 | use 5.006; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package Set::Associate::NewKey::LinearWrap; | ||
| 6 | |||
| 7 | # ABSTRACT: destructively empty the supply pool from the left hand end to give associations. | ||
| 8 | |||
| 9 | our $VERSION = '0.004000'; | ||
| 10 | |||
| 11 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | ||
| 12 | |||
| 13 | use Moose qw( with ); | ||
| 14 | |||
| 15 | with 'Set::Associate::Role::NewKey' => { can_get_assoc => 1, }; | ||
| 16 | |||
| 17 | __PACKAGE__->meta->make_immutable; | ||
| 18 | |||
| 19 | no Moose; | ||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | sub name { 'linear_wrap' } | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | sub get_assoc { | ||
| 40 | return $_[1]->_items_cache_shift; | ||
| 41 | } | ||
| 42 | |||
| 43 | 1; | ||
| 44 | |||
| 45 | __END__ | ||
| 46 | |||
| 47 | =pod | ||
| 48 | |||
| 49 | =encoding UTF-8 | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | Set::Associate::NewKey::LinearWrap - destructively empty the supply pool from the left hand end to give associations. | ||
| 54 | |||
| 55 | =head1 VERSION | ||
| 56 | |||
| 57 | version 0.004000 | ||
| 58 | |||
| 59 | =head1 METHODS | ||
| 60 | |||
| 61 | =head2 name | ||
| 62 | |||
| 63 | The name of this key assignment method ( C<linear_wrap> ) | ||
| 64 | |||
| 65 | =head2 get_assoc | ||
| 66 | |||
| 67 | Returns a value destructively by taking the first value from C<$set_assoc>'s pool. | ||
| 68 | |||
| 69 | C<$new_key> is ignored with this method. | ||
| 70 | |||
| 71 | my $value = $object->get_assoc( $set_assoc, $new_key ); | ||
| 72 | |||
| 73 | =head1 AUTHOR | ||
| 74 | |||
| 75 | Kent Fredric <kentnl@cpan.org> | ||
| 76 | |||
| 77 | =head1 COPYRIGHT AND LICENSE | ||
| 78 | |||
| 79 | This software is copyright (c) 2015 by Kent Fredric <kentfredric@gmail.com>. | ||
| 80 | |||
| 81 | This is free software; you can redistribute it and/or modify it under | ||
| 82 | the same terms as the Perl 5 programming language system itself. | ||
| 83 | |||
| 84 | =cut |