Attributes/Trait/Class.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 27 / 27 CC 3 SCAR 6.2
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Attributes/Trait/Role/Application/ToInstance.pm ↑ Summary Attributes/Trait/Role.pm »
1 #
2 # This file is part of MooseX-TrackDirty-Attributes
3 #
4 # This software is Copyright (c) 2011 by Chris Weyl.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 package MooseX::TrackDirty::Attributes::Trait::Class;
11 8 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
12 8 $MooseX::TrackDirty::Attributes::Trait::Class::AUTHORITY = 'cpan:RSRCHBOY';
13 }
14 8 $MooseX::TrackDirty::Attributes::Trait::Class::VERSION = '2.003';
15 # ABSTRACT: Attribute metaclass helper metaclass helper trait
16  
17 8 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 8 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 8 ▶use MooseX::TrackDirty::Attributes::Util ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # debug...
22 #use Smart::Comments;
23  
24  
25 # ensure that future applications of a native trait will be handled correctly
26 14 ▶after add_role_application => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
27 14 my ($self, $application) = @_;
28  
29 #my @roles = map { $_->name } $self->calculate_all_roles;
30 ### @roles
31  
32 ### in add_role_application (after)...
33 14 ▶ return unless $self->does_role('Moose::Meta::Attribute::Native::Trait');
Branch: 1 branch
BranchTrueFalseTotal
unless $self->does_role("Moose::Meta::Attribute::Native::Trait") 4 10 14
34 10 ▶ return if $self->does_role(TrackDirtyNativeTrait);
Branch: 1 branch
BranchTrueFalseTotal
if $self->does_role(&TrackDirtyNativeTrait()) 5 5 10
35  
36 ### applying TrackDirtyNativeTrait to self: $self->name
37 5 TrackDirtyNativeTrait->meta->apply($self);
38 5 return;
39 8 };
40  
41 8 !!42;
42  
43 __END__
« Attributes/Trait/Role/Application/ToInstance.pm ↑ Summary Attributes/Trait/Role.pm »