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' }
23 Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code attributes
35 sub { print "called" }
43 $foo->call; # prints "called"
47 This provides operations on coderef attributes.
49 =head1 PROVIDED METHODS
53 =item * B<execute(@args)>
55 Calls the coderef with the given args.
57 =item * B<execute_method(@args)>
59 Calls the coderef with the the instance as invocant and given args.
65 See L<Moose/BUGS> for details on reporting bugs.
69 Florian Ragwitz <rafl@debian.org>
71 =head1 COPYRIGHT AND LICENSE
73 Copyright 2007-2009 by Infinity Interactive, Inc.
75 L<http://www.iinteractive.com>
77 This library is free software; you can redistribute it and/or modify
78 it under the same terms as Perl itself.