Commit | Line | Data |
---|---|---|
8e64d0fa | 1 | package Mouse::Meta::Method; |
bc69ee88 | 2 | use Mouse::Util qw(:meta); # enables strict and warnings |
53875581 | 3 | |
8e64d0fa | 4 | use overload |
5 | '&{}' => 'body', | |
6 | fallback => 1, | |
7 | ; | |
8 | ||
9010458d | 9 | sub wrap{ |
10 | my $class = shift; | |
8e64d0fa | 11 | |
9010458d | 12 | return $class->_new(@_); |
8e64d0fa | 13 | } |
14 | ||
9010458d | 15 | sub _new{ |
16 | my $class = shift; | |
17 | return $class->meta->new_object(@_) | |
18 | if $class ne __PACKAGE__; | |
19 | ||
20 | return bless {@_}, $class; | |
21 | } | |
22 | ||
23 | sub body { $_[0]->{body} } | |
24 | sub name { $_[0]->{name} } | |
25 | sub package_name { $_[0]->{package} } | |
26 | sub associated_metaclass { $_[0]->{associated_metaclass} } | |
8e64d0fa | 27 | |
612d3e1a | 28 | sub fully_qualified_name { |
29 | my $self = shift; | |
30 | return $self->package_name . '::' . $self->name; | |
31 | } | |
8e64d0fa | 32 | |
33 | 1; | |
8e64d0fa | 34 | __END__ |
1820fffe | 35 | |
36 | =head1 NAME | |
37 | ||
38 | Mouse::Meta::Method - A Mouse Method metaclass | |
39 | ||
a25ca8d6 | 40 | =head1 VERSION |
41 | ||
034587d8 | 42 | This document describes Mouse version 0.40 |
a25ca8d6 | 43 | |
1820fffe | 44 | =head1 SEE ALSO |
45 | ||
46 | L<Moose::Meta::Method> | |
47 | ||
31c5194b | 48 | L<Class::MOP::Method> |
49 | ||
1820fffe | 50 | =cut |