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
34 default => sub { sub { print "called" } },
41 $foo->call; # prints "called"
46 This provides operations on coderef attributes.
48 =head1 PROVIDED METHODS
52 =item B<execute(@args)>
54 Calls the coderef with the given args.
56 =item B<execute_method(@args)>
58 Calls the coderef with the the instance as invocant and given args.
72 See L<Moose/BUGS> for details on reporting bugs.
76 Florian Ragwitz <rafl@debian.org>
78 =head1 COPYRIGHT AND LICENSE
80 Copyright 2007-2009 by Infinity Interactive, Inc.
82 L<http://www.iinteractive.com>
84 This library is free software; you can redistribute it and/or modify
85 it under the same terms as Perl itself.