| 1 | package Mojolicious::Plugin::Mongol; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 2 | extends 'Mojolicious::Plugin'; | |||||||||||
| 6 | |||||||||||||
| 7 | 2 | ▶ | use MongoDB; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 2 | ▶ | use Mongol; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 2 | our $VERSION = '1.0'; | |||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub register { | ||||||||||
|
Subroutine
register: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 14 | 0 | my ( $self, $app, $config ) = @_; | |||||||||||
| 15 | |||||||||||||
| 16 | 0 | ▶ | $app->attr( '_mongodb' => sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||
| 17 | 0 | ▶ | return MongoDB->connect( $config->{host}, $config->{options} || {} ); | ||||||||||
|
Condition0%0/2
$config->{'options'} || {}
MC/DC0%0/1
$config->{'options'} || {}
$config->{'options'}
Truth table0%0/2
A
A= $config->{'options'}
| |||||||||||||
| 18 | } | ||||||||||||
| 19 | 0 | ); | |||||||||||
| 20 | |||||||||||||
| 21 | 0 | ▶ | $app->helper( 'mongodb' => sub { shift()->app()->_mongodb() } ); | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 22 | |||||||||||||
| 23 | # Here's where the magic happens ... | ||||||||||||
| 24 | 0 | Mongol->map_entities( $app->_mongodb(), %{ $config->{entities} } ); | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 2 | __PACKAGE__->meta()->make_immutable( inline_constructor => 0 ); | |||||||||||
| 28 | |||||||||||||
| 29 | 2 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||