1 package Moose::Meta::Attribute::Native::Trait::Code;
4 our $VERSION = '1.9900';
5 $VERSION = eval $VERSION;
6 our $AUTHORITY = 'cpan:STEVAN';
8 with 'Moose::Meta::Attribute::Native::Trait';
10 sub _helper_type { 'CodeRef' }
20 Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code attributes
32 sub { print "called" }
40 $foo->call; # prints "called"
44 This trait provides native delegation methods for code references.
48 If you don't provide an C<isa> value for your attribute, it will default to
51 =head1 PROVIDED METHODS
55 =item * B<execute(@args)>
57 Calls the coderef with the given args.
59 =item * B<execute_method(@args)>
61 Calls the coderef with the the instance as invocant and given args.
67 See L<Moose/BUGS> for details on reporting bugs.
71 Florian Ragwitz <rafl@debian.org>
73 =head1 COPYRIGHT AND LICENSE
75 Copyright 2007-2009 by Infinity Interactive, Inc.
77 L<http://www.iinteractive.com>
79 This library is free software; you can redistribute it and/or modify
80 it under the same terms as Perl itself.