1 package Moose::Meta::Attribute::Native::Trait::Code;
5 $VERSION = eval $VERSION;
6 our $AUTHORITY = 'cpan:STEVAN';
8 use Moose::Meta::Method::Accessor::Native::Code::execute;
9 use Moose::Meta::Method::Accessor::Native::Code::execute_method;
11 with 'Moose::Meta::Attribute::Native::Trait';
13 sub _helper_type { 'CodeRef' }
15 sub _native_type { 'Code' }
25 Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code attributes
36 default => sub { sub { print "called" } },
43 $foo->call; # prints "called"
48 This provides operations on coderef attributes.
50 =head1 PROVIDED METHODS
54 =item B<execute(@args)>
56 Calls the coderef with the given args.
58 =item B<execute_method(@args)>
60 Calls the coderef with the the instance as invocant and given args.
70 =item B<method_provider>
72 =item B<has_method_provider>
78 See L<Moose/BUGS> for details on reporting bugs.
82 Florian Ragwitz <rafl@debian.org>
84 =head1 COPYRIGHT AND LICENSE
86 Copyright 2007-2009 by Infinity Interactive, Inc.
88 L<http://www.iinteractive.com>
90 This library is free software; you can redistribute it and/or modify
91 it under the same terms as Perl itself.