Mojito/Page/CRUD.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.6% 29 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Mojito/Collection/CRUD.pm ↑ Summary Mojito/Model/Doc.pm »
1 3 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Mojito::Page::CRUD;
3 3 $Mojito::Page::CRUD::VERSION = '0.25';
4 3 ▶use Mojito::Page::CRUD::Mongo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Mojito::Page::CRUD::Deep;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Mojito::Page::CRUD::Elasticsearch;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 Name
10  
11 Mojito::Page::CRUD - the CRUD delegator class
12  
13 =cut
14  
15 3 has 'editer' => (
16 is => 'ro',
17 lazy => 1,
18 writer => '_set_editer',
19 handles => [ qw( create read update delete db collection get_all ) ],
20 );
21  
22 3 has 'config' => ( is => 'ro', required => 1);
23  
24 1 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
25 1 my ($self, $constructor_args_href) = @_;
26
27 # Determine the document store backend from the configuration
28 1 my $doc_storage = ucfirst lc $constructor_args_href->{config}->{document_storage};
29 1 my $delegatee = __PACKAGE__ . '::' . $doc_storage;
30 1 $self->_set_editer($delegatee->new($constructor_args_href));
31 }
32  
33 3 1;
« Mojito/Collection/CRUD.pm ↑ Summary Mojito/Model/Doc.pm »