File Coverage

blib/lib/MooseX/TrackDirty/Attributes/Trait/Method/Accessor/Native.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 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::Method::Accessor::Native;
11             {
12             $MooseX::TrackDirty::Attributes::Trait::Method::Accessor::Native::VERSION = '1.900'; # TRIAL
13             }
14              
15             # ABSTRACT: Shim trait for handling native trait's writer accessor classes
16              
17 8     8   17033 use Moose::Role;
  8         11  
  8         52  
18 8     8   27254 use namespace::autoclean;
  8         14  
  8         61  
19              
20             # debugging...
21             #use Smart::Comments;
22              
23             Moose::Exporter->setup_import_methods(
24             trait_aliases => [
25             [ __PACKAGE__, 'AccessorNativeTrait' ],
26             ],
27             );
28              
29             requires '_inline_optimized_set_new_value';
30              
31             around _inline_optimized_set_new_value => sub {
32             my ($orig, $self) = (shift, shift);
33             my ($inv, $new, $slot_access) = @_;
34              
35             my $original = $self->$orig(@_);
36              
37             ### @_
38             ### $original
39              
40             my $code = $self
41             ->associated_attribute
42             ->_inline_set_dirty_slot_if_dirty(@_)
43             ;
44              
45             $code = "do { $code; $original };";
46              
47             ### $code
48             return $code;
49             };
50              
51             !!42;
52              
53              
54              
55             =pod
56              
57             =encoding utf-8
58              
59             =head1 NAME
60              
61             MooseX::TrackDirty::Attributes::Trait::Method::Accessor::Native - Shim trait for handling native trait's writer accessor classes
62              
63             =head1 VERSION
64              
65             This document describes 1.900 of MooseX::TrackDirty::Attributes::Trait::Method::Accessor::Native - released February 15, 2012 as part of MooseX-TrackDirty-Attributes.
66              
67             =head1 SEE ALSO
68              
69             Please see those modules/websites for more information related to this module.
70              
71             =over 4
72              
73             =item *
74              
75             L<MooseX::TrackDirty::Attributes|MooseX::TrackDirty::Attributes>
76              
77             =back
78              
79             =head1 SOURCE
80              
81             The development version is on github at L<http://github.com/RsrchBoy/moosex-trackdirty-attributes>
82             and may be cloned from L<git://github.com/RsrchBoy/moosex-trackdirty-attributes.git>
83              
84             =head1 BUGS
85              
86             Please report any bugs or feature requests on the bugtracker website
87             https://github.com/RsrchBoy/moosex-trackdirty-attributes/issues
88              
89             When submitting a bug or request, please include a test-file or a
90             patch to an existing test-file that illustrates the bug or desired
91             feature.
92              
93             =head1 AUTHOR
94              
95             Chris Weyl <cweyl@alumni.drew.edu>
96              
97             =head1 COPYRIGHT AND LICENSE
98              
99             This software is Copyright (c) 2011 by Chris Weyl.
100              
101             This is free software, licensed under:
102              
103             The GNU Lesser General Public License, Version 2.1, February 1999
104              
105             =cut
106              
107              
108             __END__
109