File Coverage

blib/lib/MooseX/TrackDirty/Attributes/Trait/Class.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
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             {
12             $MooseX::TrackDirty::Attributes::Trait::Class::VERSION = '1.900'; # TRIAL
13             }
14              
15             # ABSTRACT: Attribute metaclass helper metaclass helper trait
16              
17 11     11   23805 use Moose::Role;
  11         16  
  11         78  
18 11     11   37724 use namespace::autoclean;
  11         17  
  11         91  
19 11     11   652 use MooseX::TrackDirty::Attributes::Util ':all';
  11         14  
  11         75  
20              
21             # debug...
22             #use Smart::Comments;
23              
24              
25             # ensure that future applications of a native trait will be handled correctly
26             after add_role_application => sub {
27             my ($self, $application) = @_;
28              
29             #my @roles = map { $_->name } $self->calculate_all_roles;
30             ### @roles
31              
32             ### in add_role_application (after)...
33             return unless $self->does_role('Moose::Meta::Attribute::Native::Trait');
34             return if $self->does_role(TrackDirtyNativeTrait);
35              
36             ### applying TrackDirtyNativeTrait to self: $self->name
37             TrackDirtyNativeTrait->meta->apply($self);
38             return;
39             };
40              
41             !!42;
42              
43             __END__
44             =pod
45              
46             =encoding utf-8
47              
48             =head1 NAME
49              
50             MooseX::TrackDirty::Attributes::Trait::Class - Attribute metaclass helper metaclass helper trait
51              
52             =head1 VERSION
53              
54             This document describes 1.900 of MooseX::TrackDirty::Attributes::Trait::Class - released February 15, 2012 as part of MooseX-TrackDirty-Attributes.
55              
56             =head1 METHODS
57              
58             =head2 add_role_application
59              
60             This method is extended to ensure that if our attribute metaclass starts doing
61             a native trait, that our native trait compatibility trait is also applied.
62              
63             =head1 SEE ALSO
64              
65             Please see those modules/websites for more information related to this module.
66              
67             =over 4
68              
69             =item *
70              
71             L<MooseX::TrackDirty::Attributes|MooseX::TrackDirty::Attributes>
72              
73             =back
74              
75             =head1 SOURCE
76              
77             The development version is on github at L<http://github.com/RsrchBoy/moosex-trackdirty-attributes>
78             and may be cloned from L<git://github.com/RsrchBoy/moosex-trackdirty-attributes.git>
79              
80             =head1 BUGS
81              
82             Please report any bugs or feature requests on the bugtracker website
83             https://github.com/RsrchBoy/moosex-trackdirty-attributes/issues
84              
85             When submitting a bug or request, please include a test-file or a
86             patch to an existing test-file that illustrates the bug or desired
87             feature.
88              
89             =head1 AUTHOR
90              
91             Chris Weyl <cweyl@alumni.drew.edu>
92              
93             =head1 COPYRIGHT AND LICENSE
94              
95             This software is Copyright (c) 2011 by Chris Weyl.
96              
97             This is free software, licensed under:
98              
99             The GNU Lesser General Public License, Version 2.1, February 1999
100              
101             =cut
102