| 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
| |||||||||||
| 34 | 10 | ▶ | return if $self->does_role(TrackDirtyNativeTrait); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||