Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / MooseX / MethodAttributes / Role / Meta / Method / MaybeWrapped.pm
1 package MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped;
2 our $VERSION = '0.18';
3
4 # ABSTRACT: proxy attributes of wrapped methods if their metaclass supports it
5
6 use Moose::Role;
7 use Moose::Util qw/does_role/;
8 use MooseX::MethodAttributes::Role::Meta::Method::Wrapped;
9
10 use namespace::clean -except => 'meta';
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 =head1 NAME
31
32 MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped - proxy attributes of wrapped methods if their metaclass supports it
33
34 =head1 VERSION
35
36 version 0.18
37
38 =head1 AUTHORS
39
40   Florian Ragwitz <rafl@debian.org>
41   Tomas Doran <bobtfish@bobtfish.net>
42
43 =head1 COPYRIGHT AND LICENSE
44
45 This software is copyright (c) 2009 by Florian Ragwitz.
46
47 This is free software; you can redistribute it and/or modify it under
48 the same terms as perl itself.
49
50 =cut 
51
52