Sitemap/URLStore/Memory.pm untested

filter: Statementstmt 0.0% 0 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 48 CC 1 SCAR 6.9
CC
1
Cov
0%
get
2.0
put
2.0
all
2.0
CRAP 2.0
1 package Search::Sitemap::URLStore::Memory;
2 $Search::Sitemap::URLStore::Memory::VERSION = '2.13_01';
3 use 5.008003;
4 use strict;
5 use warnings;
6 our $AUTHORITY = 'cpan:JASONK';
7 use Moose;
8 extends 'Search::Sitemap::URLStore';
9 use MooseX::Types::Moose qw( HashRef );
10 use Class::Trigger;
11 use namespace::clean -except => 'meta';
12  
13 has 'storage' => ( is => 'ro', isa => HashRef, default => sub { {} } );
14  
15 sub get {
16 my ( $self, $url ) = @_;
17 return $self->storage->{ $url };
18 }
19  
20 sub put {
21 my $self = shift;
22  
23 $self->storage->{ $_->loc } = $_ for @_;
24  
25 return 1;
26 }
27  
28 sub all { return values %{ shift->storage } }
29  
30 __PACKAGE__->meta->make_immutable;
31 1;
32 __END__