File Coverage

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