File Coverage

blib/lib/MooseX/MethodAttributes/Role/Meta/Method/MaybeWrapped.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped;
2             # ABSTRACT: proxy attributes of wrapped methods if their metaclass supports it
3              
4             our $VERSION = '0.32';
5              
6 19     19   115360 use Moose::Role;
  19         85  
  19         180  
7 19     19   105608 use Moose::Util qw/does_role/;
  19         53  
  19         158  
8 19     19   14978 use MooseX::MethodAttributes::Role::Meta::Method::Wrapped;
  19         65  
  19         842  
9              
10 19     19   148 use namespace::autoclean;
  19         46  
  19         91  
11              
12             override wrap => sub {
13             my $self = super;
14             my $original_method = $self->get_original_method;
15             if (
16             does_role($original_method, 'MooseX::MethodAttributes::Role::Meta::Method')
17             || does_role($original_method, 'MooseX::MethodAttributes::Role::Meta::Method::Wrapped')
18             ) {
19             MooseX::MethodAttributes::Role::Meta::Method::Wrapped->meta->apply($self);
20             }
21             return $self;
22             };
23              
24             1;
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped - proxy attributes of wrapped methods if their metaclass supports it
35              
36             =head1 VERSION
37              
38             version 0.32
39              
40             =head1 SUPPORT
41              
42             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-MethodAttributes>
43             (or L<bug-MooseX-MethodAttributes@rt.cpan.org|mailto:bug-MooseX-MethodAttributes@rt.cpan.org>).
44              
45             There is also a mailing list available for users of this distribution, at
46             L<http://lists.perl.org/list/moose.html>.
47              
48             There is also an irc channel available for users of this distribution, at
49             L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>.
50              
51             =head1 AUTHORS
52              
53             =over 4
54              
55             =item *
56              
57             Florian Ragwitz <rafl@debian.org>
58              
59             =item *
60              
61             Tomas Doran <bobtfish@bobtfish.net>
62              
63             =back
64              
65             =head1 COPYRIGHT AND LICENCE
66              
67             This software is copyright (c) 2009 by Florian Ragwitz.
68              
69             This is free software; you can redistribute it and/or modify it under
70             the same terms as the Perl 5 programming language system itself.
71              
72             =cut