File Coverage

blib/lib/KiokuDB/Set/Transient.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition n/a
subroutine 7 8 87.5
pod 0 5 0.0
total 24 32 75.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package KiokuDB::Set::Transient;
4 2     2   9 use Moose;
  2         2  
  2         9  
5              
6 2     2   8671 use Carp qw(croak);
  2         3  
  2         99  
7              
8 2     2   17 use namespace::clean -except => 'meta';
  2         4  
  2         19  
9              
10             with qw(KiokuDB::Set);
11              
12             extends qw(KiokuDB::Set::Base);
13              
14 99     99 0 352 sub loaded { 1 }
15              
16 0     0 0 0 sub includes { shift->_objects->includes(@_) }
17 33     33 0 1217 sub remove { shift->_objects->remove(@_) }
18 99     99 0 3125 sub members { shift->_objects->members }
19              
20             sub insert {
21 99     99 0 264 my ( $self, @objects ) = @_;
22 99 50       180 croak "Can't insert non reference into a KiokuDB::Set" if grep { not ref } @objects;
  99         435  
23 99         3458 $self->_objects->insert(@objects)
24             }
25              
26             __PACKAGE__->meta->make_immutable;
27              
28             __PACKAGE__
29              
30             __END__
31              
32             =pod
33              
34             =head1 NAME
35              
36             KiokuDB::Set::Transient - Implementation of in memory sets.
37              
38             =head1 SYNOPSIS
39              
40             my $set = KiokuDB::Set::Transient->new(
41             set => Set::Object->new( @objects ),
42             );
43              
44             # or
45              
46             use KiokuDB::Util qw(set);
47              
48             my $set = set(@objects);
49              
50             =head1 DESCRIPTION
51              
52             This class implements sets conforming to the L<KiokuDB::Set> API.
53              
54             These sets can be constructed by the user for insertion into storage.
55              
56             See L<KiokuDB::Set> for more details.
57              
58             =cut
59