| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package MooseX::MethodAttributes; # git description: v0.30-2-gc4a23df | 
| 2 |  |  |  |  |  |  | # ABSTRACT: Code attribute introspection | 
| 3 |  |  |  |  |  |  |  | 
| 4 |  |  |  |  |  |  | our $VERSION = '0.31'; | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 21 |  |  | 21 |  | 4475773 | use Moose (); | 
|  | 21 |  |  |  |  | 2635903 |  | 
|  | 21 |  |  |  |  | 561 |  | 
| 7 | 21 |  |  | 21 |  | 157 | use Moose::Exporter; | 
|  | 21 |  |  |  |  | 44 |  | 
|  | 21 |  |  |  |  | 196 |  | 
| 8 | 21 |  |  | 21 |  | 790 | use Moose::Util::MetaRole; | 
|  | 21 |  |  |  |  | 41 |  | 
|  | 21 |  |  |  |  | 538 |  | 
| 9 | 21 |  |  | 21 |  | 102 | use Moose::Util qw/find_meta does_role/; | 
|  | 21 |  |  |  |  | 42 |  | 
|  | 21 |  |  |  |  | 185 |  | 
| 10 |  |  |  |  |  |  | # Ensure trait is registered | 
| 11 | 21 |  |  | 21 |  | 22890 | use MooseX::MethodAttributes::Role::Meta::Role (); | 
|  | 21 |  |  |  |  | 67 |  | 
|  | 21 |  |  |  |  | 694 |  | 
| 12 | 21 |  |  | 21 |  | 830 | use namespace::autoclean; | 
|  | 21 |  |  |  |  | 7672 |  | 
|  | 21 |  |  |  |  | 101 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | #pod =head1 SYNOPSIS | 
| 15 |  |  |  |  |  |  | #pod | 
| 16 |  |  |  |  |  |  | #pod     package MyClass; | 
| 17 |  |  |  |  |  |  | #pod | 
| 18 |  |  |  |  |  |  | #pod     use Moose; | 
| 19 |  |  |  |  |  |  | #pod     use MooseX::MethodAttributes; | 
| 20 |  |  |  |  |  |  | #pod | 
| 21 |  |  |  |  |  |  | #pod     sub foo : Bar Baz('corge') { ... } | 
| 22 |  |  |  |  |  |  | #pod | 
| 23 |  |  |  |  |  |  | #pod     my $attrs = MyClass->meta->get_method('foo')->attributes; # ["Bar", "Baz('corge')"] | 
| 24 |  |  |  |  |  |  | #pod | 
| 25 |  |  |  |  |  |  | #pod =head1 DESCRIPTION | 
| 26 |  |  |  |  |  |  | #pod | 
| 27 |  |  |  |  |  |  | #pod This module allows code attributes of methods to be introspected using Moose | 
| 28 |  |  |  |  |  |  | #pod meta method objects. | 
| 29 |  |  |  |  |  |  | #pod | 
| 30 |  |  |  |  |  |  | #pod =begin Pod::Coverage | 
| 31 |  |  |  |  |  |  | #pod | 
| 32 |  |  |  |  |  |  | #pod init_meta | 
| 33 |  |  |  |  |  |  | #pod | 
| 34 |  |  |  |  |  |  | #pod =end Pod::Coverage | 
| 35 |  |  |  |  |  |  | #pod | 
| 36 |  |  |  |  |  |  | #pod =cut | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | Moose::Exporter->setup_import_methods( | 
| 39 |  |  |  |  |  |  | also => 'Moose', | 
| 40 |  |  |  |  |  |  | ); | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | sub init_meta { | 
| 43 | 47 |  |  | 47 | 0 | 24592 | my ($class, %options) = @_; | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 47 |  |  |  |  | 120 | my $for_class = $options{for_class}; | 
| 46 | 47 |  |  |  |  | 174 | my $meta = find_meta($for_class); | 
| 47 |  |  |  |  |  |  |  | 
| 48 | 47 | 50 | 100 |  |  | 662 | return $meta if $meta | 
|  |  |  | 66 |  |  |  |  | 
|  |  |  | 66 |  |  |  |  | 
| 49 |  |  |  |  |  |  | && does_role($meta, 'MooseX::MethodAttributes::Role::Meta::Class') | 
| 50 |  |  |  |  |  |  | && does_role($meta->method_metaclass, 'MooseX::MethodAttributes::Role::Meta::Method') | 
| 51 |  |  |  |  |  |  | && does_role($meta->wrapped_method_metaclass, 'MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped'); | 
| 52 |  |  |  |  |  |  |  | 
| 53 | 22 | 100 |  |  |  | 2647 | $meta = Moose::Meta::Class->create( $for_class ) | 
| 54 |  |  |  |  |  |  | unless $meta; | 
| 55 |  |  |  |  |  |  |  | 
| 56 | 22 |  |  |  |  | 15493 | $meta = Moose::Util::MetaRole::apply_metaroles( | 
| 57 |  |  |  |  |  |  | for             => $for_class, | 
| 58 |  |  |  |  |  |  | class_metaroles => { | 
| 59 |  |  |  |  |  |  | class  => ['MooseX::MethodAttributes::Role::Meta::Class'], | 
| 60 |  |  |  |  |  |  | method => ['MooseX::MethodAttributes::Role::Meta::Method'], | 
| 61 |  |  |  |  |  |  | wrapped_method => [ | 
| 62 |  |  |  |  |  |  | 'MooseX::MethodAttributes::Role::Meta::Method::MaybeWrapped'], | 
| 63 |  |  |  |  |  |  | }, | 
| 64 |  |  |  |  |  |  | ); | 
| 65 |  |  |  |  |  |  |  | 
| 66 | 22 |  |  |  |  | 90831 | Moose::Util::MetaRole::apply_base_class_roles( | 
| 67 |  |  |  |  |  |  | for_class => $for_class, | 
| 68 |  |  |  |  |  |  | roles     => ['MooseX::MethodAttributes::Role::AttrContainer'], | 
| 69 |  |  |  |  |  |  | ); | 
| 70 |  |  |  |  |  |  |  | 
| 71 | 22 |  |  |  |  | 47781 | return $meta; | 
| 72 |  |  |  |  |  |  | } | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | 1; | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | __END__ | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | =pod | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  | =encoding UTF-8 | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  | =head1 NAME | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | MooseX::MethodAttributes - Code attribute introspection | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | =head1 VERSION | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  | version 0.31 | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | package MyClass; | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | use Moose; | 
| 95 |  |  |  |  |  |  | use MooseX::MethodAttributes; | 
| 96 |  |  |  |  |  |  |  | 
| 97 |  |  |  |  |  |  | sub foo : Bar Baz('corge') { ... } | 
| 98 |  |  |  |  |  |  |  | 
| 99 |  |  |  |  |  |  | my $attrs = MyClass->meta->get_method('foo')->attributes; # ["Bar", "Baz('corge')"] | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | This module allows code attributes of methods to be introspected using Moose | 
| 104 |  |  |  |  |  |  | meta method objects. | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | =for Pod::Coverage init_meta | 
| 107 |  |  |  |  |  |  |  | 
| 108 |  |  |  |  |  |  | =head1 SUPPORT | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  | Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-MethodAttributes> | 
| 111 |  |  |  |  |  |  | (or L<bug-MooseX-MethodAttributes@rt.cpan.org|mailto:bug-MooseX-MethodAttributes@rt.cpan.org>). | 
| 112 |  |  |  |  |  |  |  | 
| 113 |  |  |  |  |  |  | There is also a mailing list available for users of this distribution, at | 
| 114 |  |  |  |  |  |  | L<http://lists.perl.org/list/moose.html>. | 
| 115 |  |  |  |  |  |  |  | 
| 116 |  |  |  |  |  |  | There is also an irc channel available for users of this distribution, at | 
| 117 |  |  |  |  |  |  | irc://irc.perl.org/#moose. | 
| 118 |  |  |  |  |  |  |  | 
| 119 |  |  |  |  |  |  | =head1 AUTHORS | 
| 120 |  |  |  |  |  |  |  | 
| 121 |  |  |  |  |  |  | =over 4 | 
| 122 |  |  |  |  |  |  |  | 
| 123 |  |  |  |  |  |  | =item * | 
| 124 |  |  |  |  |  |  |  | 
| 125 |  |  |  |  |  |  | Florian Ragwitz <rafl@debian.org> | 
| 126 |  |  |  |  |  |  |  | 
| 127 |  |  |  |  |  |  | =item * | 
| 128 |  |  |  |  |  |  |  | 
| 129 |  |  |  |  |  |  | Tomas Doran <bobtfish@bobtfish.net> | 
| 130 |  |  |  |  |  |  |  | 
| 131 |  |  |  |  |  |  | =back | 
| 132 |  |  |  |  |  |  |  | 
| 133 |  |  |  |  |  |  | =head1 CONTRIBUTORS | 
| 134 |  |  |  |  |  |  |  | 
| 135 |  |  |  |  |  |  | =for stopwords Karen Etheridge Dave Rolsky Marcus Ramberg Peter E Karman David Steinbrunner | 
| 136 |  |  |  |  |  |  |  | 
| 137 |  |  |  |  |  |  | =over 4 | 
| 138 |  |  |  |  |  |  |  | 
| 139 |  |  |  |  |  |  | =item * | 
| 140 |  |  |  |  |  |  |  | 
| 141 |  |  |  |  |  |  | Karen Etheridge <ether@cpan.org> | 
| 142 |  |  |  |  |  |  |  | 
| 143 |  |  |  |  |  |  | =item * | 
| 144 |  |  |  |  |  |  |  | 
| 145 |  |  |  |  |  |  | Dave Rolsky <autarch@urth.org> | 
| 146 |  |  |  |  |  |  |  | 
| 147 |  |  |  |  |  |  | =item * | 
| 148 |  |  |  |  |  |  |  | 
| 149 |  |  |  |  |  |  | Marcus Ramberg <marcus@nordaaker.com> | 
| 150 |  |  |  |  |  |  |  | 
| 151 |  |  |  |  |  |  | =item * | 
| 152 |  |  |  |  |  |  |  | 
| 153 |  |  |  |  |  |  | Peter E Karman <pek@dewpoint.msi.umn.edu> | 
| 154 |  |  |  |  |  |  |  | 
| 155 |  |  |  |  |  |  | =item * | 
| 156 |  |  |  |  |  |  |  | 
| 157 |  |  |  |  |  |  | David Steinbrunner <dsteinbrunner@pobox.com> | 
| 158 |  |  |  |  |  |  |  | 
| 159 |  |  |  |  |  |  | =back | 
| 160 |  |  |  |  |  |  |  | 
| 161 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENCE | 
| 162 |  |  |  |  |  |  |  | 
| 163 |  |  |  |  |  |  | This software is copyright (c) 2009 by Florian Ragwitz. | 
| 164 |  |  |  |  |  |  |  | 
| 165 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 166 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 167 |  |  |  |  |  |  |  | 
| 168 |  |  |  |  |  |  | =cut |