| 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::Role; | ||||||||||
| 11 | 9 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 9 | $MooseX::TrackDirty::Attributes::Trait::Role::AUTHORITY = 'cpan:RSRCHBOY'; | |||||||||
| 13 | } | ||||||||||
| 14 | # Dist::Zilla: +PkgVersion | ||||||||||
| 15 | 9 | $MooseX::TrackDirty::Attributes::Trait::Role::VERSION = '2.003'; | |||||||||
| 16 | 9 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 9 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 9 | ▶ | use MooseX::TrackDirty::Attributes::Util ':all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | # debugging... | ||||||||||
| 22 | #use Smart::Comments; | ||||||||||
| 23 | |||||||||||
| 24 | # ensure that future applications of a native trait will be handled correctly | ||||||||||
| 25 | 1 | ▶ | after add_role => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=9.2
| |||||||||||
| 26 | 1 | my ($self, $other) = @_; | |||||||||
| 27 | |||||||||||
| 28 | ### checking: $self->name | ||||||||||
| 29 | 1 | ▶ | return unless $self->does_role('Moose::Meta::Attribute::Native::Trait'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | |||||||||||
| 31 | ### applying to self... | ||||||||||
| 32 | 0 | TrackDirtyNativeTrait->meta->apply($self); | |||||||||
| 33 | 0 | return; | |||||||||
| 34 | 9 | }; | |||||||||
| 35 | |||||||||||
| 36 | 3 | ▶ | around composition_class_roles => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 3 | my ($orig, $self) = (shift, shift); | |||||||||
| 38 | |||||||||||
| 39 | ### in our composition_class_roles()... | ||||||||||
| 40 | 3 | return ($self->$orig(@_), Composite); | |||||||||
| 41 | 9 | }; | |||||||||
| 42 | |||||||||||
| 43 | 9 | !!42; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||