blib/lib/slots.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 24 / 24 CC 2 SCAR 2.9
CC
2
Cov
100%
import
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package slots;
2 # ABSTRACT: A simple pragma for managing class slots.
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use MOP ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $VERSION = '0.03';
10 1 our $AUTHORITY = 'cpan:STEVAN';
11  
12 2 ▶sub import {
Subroutine import: called CC=2 SCAR=6.9
13 2 shift;
14 2 my $pkg = caller(0);
15 2 my $meta = MOP::Util::get_meta( $pkg );
16 2 my %slots = @_;
17  
18 2 $meta->add_slot( $_, $slots{ $_ } ) for keys %slots;
19  
20 2 ▶ MOP::Util::defer_until_UNITCHECK(sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
21 2 MOP::Util::inherit_slots( MOP::Util::get_meta( $pkg ) )
22 2 });
23 }
24  
25 1 1;
26  
27 __END__
↑ Summary