File Coverage

blib/lib/Code/Style/Kit/Parts/Moo.pm
Criterion Covered Total %
statement 24 24 100.0
branch 2 4 50.0
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 34 40 85.0


line stmt bran cond sub pod time code
1             package Code::Style::Kit::Parts::Moo;
2 1     1   455 use strict;
  1         2  
  1         42  
3 1     1   5 use warnings;
  1         2  
  1         39  
4             our $VERSION = '1.0.3'; # VERSION
5             # ABSTRACT: Moo-based OO
6              
7              
8 1     1   5 use Import::Into;
  1         2  
  1         22  
9 1     1   5 use Carp;
  1         2  
  1         210  
10              
11 3     3 0 8 sub feature_class_default { 0 }
12             sub feature_class_export {
13 2     2 0 5 my ($self, $caller) = @_;
14              
15 2 50       12 croak "can't be both a class and a role"
16             if $self->is_feature_requested('role');
17              
18 2         21 require Moo;
19 2         18 Moo->import::into($caller);
20 2         2126 $self->maybe_also_export('types');
21             }
22              
23 3     3 0 6 sub feature_role_default { 0 }
24             sub feature_role_export {
25 1     1 0 3 my ($self, $caller) = @_;
26              
27 1 50       7 croak "can't be both a class and a role"
28             if $self->is_feature_requested('class');
29              
30 1         7 require Moo::Role;
31 1         19 Moo::Role->import::into($caller);
32 1         550 $self->maybe_also_export('types');
33             }
34              
35             1;
36              
37             __END__