File Coverage

blib/lib/Pod/Coverage/mop.pm
Criterion Covered Total %
statement 13 15 86.6
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 20 90.0


line stmt bran cond sub pod time code
1             package Pod::Coverage::mop;
2              
3 1     1   979 use strict;
  1         3  
  1         40  
4 1     1   5 use warnings;
  1         2  
  1         33  
5 1     1   32 use 5.010;
  1         3  
  1         37  
6 1     1   5 use Carp;
  1         2  
  1         90  
7              
8 1     1   566 use mop;
  0            
  0            
9              
10             our $VERSION = '0.002';
11              
12             class Pod::Coverage::mop
13             extends Pod::Coverage::CountParents {
14              
15             use Pod::Coverage::CountParents;
16             use Module::Load;
17              
18             method new($class: %args) {
19              
20             # here we need to put methods defined by consumed roles in
21             # trustme, even if the class does not define them itself;
22             # DEMOLISH BUILD BUILDARGS go into also_trustme
23              
24             my $package = $args{package};
25             load $package;
26             if (my $meta = mop::meta($package)) {
27             # ok. we can do this
28             return $class->next::method(%args);
29             }
30              
31             # not meta (or not mop anyway). do everything with the
32             # regular class. if it's not able to cope with the foreign
33             # meta, too bad
34             return Pod::Coverage::CountParents->new(%args);
35              
36             }
37              
38             method _get_syms($package) {
39             # run around the class meta, get the list of methods -- ignore
40             # anything declared as a regular sub in the package -- if it
41             # ain't got a meta it ain't one of ours. attributes are
42             # ignored unless they have an accessor, which will be caught
43             # as a method
44             my @symbols;
45             foreach my $method (mop::meta($package)->methods) {
46             next if $self->_private_check($method->name);
47             next unless $method->locally_defined;
48             push @symbols, $method->name;
49             }
50             return @symbols;
51             }
52              
53             }
54              
55             __END__