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.
68 =item B<method_provider>
70 =item B<has_method_provider>
76 See L<Moose/BUGS> for details on reporting bugs.
80 Florian Ragwitz <rafl@debian.org>
82 =head1 COPYRIGHT AND LICENSE
84 Copyright 2007-2009 by Infinity Interactive, Inc.
86 L<http://www.iinteractive.com>
88 This library is free software; you can redistribute it and/or modify
89 it under the same terms as Perl itself.