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   461 use strict;
  1         2  
  1         26  
3 1     1   16 use warnings;
  1         2  
  1         38  
4             our $VERSION = '1.0.1'; # VERSION
5             # ABSTRACT: Moo-based OO
6              
7              
8 1     1   5 use Import::Into;
  1         1  
  1         23  
9 1     1   4 use Carp;
  1         1  
  1         211  
10              
11 3     3 0 9 sub feature_class_default { 0 }
12             sub feature_class_export {
13 2     2 0 4 my ($self, $caller) = @_;
14              
15 2 50       21 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         27 Moo->import::into($caller);
20 2         1958 $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 2 my ($self, $caller) = @_;
26              
27 1 50       6 croak "can't be both a class and a role"
28             if $self->is_feature_requested('class');
29              
30 1         5 require Moo::Role;
31 1         8 Moo::Role->import::into($caller);
32 1         563 $self->maybe_also_export('types');
33             }
34              
35             1;
36              
37             __END__