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