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 trait provides native delegation methods for code references.
51 If you don't provide an C<isa> value for your attribute, it will default to
54 =head1 PROVIDED METHODS
58 =item * B<execute(@args)>
60 Calls the coderef with the given args.
62 =item * B<execute_method(@args)>
64 Calls the coderef with the the instance as invocant and given args.
70 See L<Moose/BUGS> for details on reporting bugs.
74 Florian Ragwitz <rafl@debian.org>
76 =head1 COPYRIGHT AND LICENSE
78 Copyright 2007-2009 by Infinity Interactive, Inc.
80 L<http://www.iinteractive.com>
82 This library is free software; you can redistribute it and/or modify
83 it under the same terms as Perl itself.