2dfc0ff1ed59b0ec7fb3048a8cecd25b59108d7f
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / MethodProvider / Code.pm
1 package Moose::Meta::Attribute::Native::MethodProvider::Code;
2 use Moose::Role;
3
4 our $VERSION   = '0.95';
5 $VERSION = eval $VERSION;
6 our $AUTHORITY = 'cpan:STEVAN';
7
8 sub execute : method {
9     my ($attr, $reader, $writer) = @_;
10     return sub {
11         my ($self, @args) = @_;
12         $reader->($self)->(@args);
13     };
14 }
15
16 sub execute_method : method {
17     my ($attr, $reader, $writer) = @_;
18     return sub {
19         my ($self, @args) = @_;
20         $reader->($self)->($self, @args);
21     };
22 }
23
24 no Moose::Role;
25
26 1;
27
28 __END__
29
30 =pod
31
32 =head1 NAME
33
34 Moose::Meta::Attribute::Native::MethodProvider::Code
35
36 =head1 DESCRIPTION
37
38 This is a role which provides the method generators for
39 L<Moose::Meta::Attribute::Native::Trait::Code>. Please check there for
40 documentation on what methods are provided.
41
42 =head1 METHODS
43
44 =over 4
45
46 =item B<meta>
47
48 =back
49
50 =head1 BUGS
51
52 See L<Moose/BUGS> for details on reporting bugs.
53
54 =head1 AUTHOR
55
56   Florian Ragwitz <rafl@debian.org>
57
58 =head1 COPYRIGHT AND LICENSE
59
60 Copyright 2007-2009 by Infinity Interactive, Inc.
61
62 L<http://www.iinteractive.com>
63
64 This library is free software; you can redistribute it and/or modify
65 it under the same terms as Perl itself.
66
67 =cut