blib/lib/Langertha/Role/StaticModels.pm

filter: Statementstmt 100% 10 / 10 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 15 / 15 CC 2 SCAR 5.1
CC
2
Cov
100%
list_models
2.0
BEGIN
1.0
CRAP 1.7
« blib/lib/Langertha/Manifest/Endpoint.pm ↑ Summary blib/lib/Langertha/Role/JSON.pm »
1 package Langertha::Role::StaticModels;
2 # ABSTRACT: Role for engines with a hardcoded model list
3 55 our $VERSION = '0.505';
4 55 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 55 has static_models => (
8 is => 'ro',
9 isa => 'ArrayRef[HashRef]',
10 lazy_build => 1,
11 );
12  
13  
14 10 ▶sub list_models {
Subroutine list_models: called CC=2 SCAR=6.9
Pod documented
15 10 my ($self, %opts) = @_;
16 10 my $models = $self->static_models;
17 10 ▶ return $opts{full} ? $models : [map { $_->{id} } @$models];
Branch: 1 branch
BranchTrueFalseTotal
$opts{'full'} ? : 4 6 10
18 }
19  
20  
21  
22 55 1;
23  
24 __END__
« blib/lib/Langertha/Manifest/Endpoint.pm ↑ Summary blib/lib/Langertha/Role/JSON.pm »