| 1 | 4 | ▶ | use strictures 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | package Mojito::Collection::CRUD; | ||
| 3 | 4 | $Mojito::Collection::CRUD::VERSION = '0.25'; | |
| 4 | 4 | ▶ | use Mojito::Collection::CRUD::Mongo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use Mojito::Collection::CRUD::Deep; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use Mojito::Collection::CRUD::Elasticsearch; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 4 | has 'editer' => ( | |
| 10 | is => 'ro', | ||
| 11 | lazy => 1, | ||
| 12 | writer => '_set_editer', | ||
| 13 | handles => [ qw( create read update delete db ) ], | ||
| 14 | ); | ||
| 15 | |||
| 16 | 1 | ▶ | sub BUILD { |
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | 1 | my ($self, $constructor_args_href) = @_; | |
| 18 | |||
| 19 | # Determine the document store backend from the configuration | ||
| 20 | 1 | my $doc_storage = ucfirst lc $constructor_args_href->{config}->{document_storage}; | |
| 21 | 1 | my $delegatee = __PACKAGE__ . '::' . $doc_storage; | |
| 22 | 1 | $self->_set_editer($delegatee->new($constructor_args_href)); | |
| 23 | } | ||
| 24 | |||
| 25 | 4 | 1; | |