1 package Moose::Meta::Attribute::Native::Trait::Code;
3 use Moose::Meta::Attribute::Native::MethodProvider::Code;
6 $VERSION = eval $VERSION;
7 our $AUTHORITY = 'cpan:STEVAN';
9 with 'Moose::Meta::Attribute::Native::Trait';
11 has method_provider => (
14 predicate => 'has_method_provider',
15 default => 'Moose::Meta::Attribute::Native::MethodProvider::Code',
18 sub _helper_type { 'CodeRef' }
28 Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code attributes
39 default => sub { sub { print "called" } },
46 $foo->call; # prints "called"
51 This provides operations on coderef attributes.
53 =head1 PROVIDED METHODS
57 =item B<execute(@args)>
59 Calls the coderef with the given args.
61 =item B<execute_method(@args)>
63 Calls the coderef with the the instance as invocant and given args.
73 =item B<method_provider>
75 =item B<has_method_provider>
81 See L<Moose/BUGS> for details on reporting bugs.
85 Florian Ragwitz <rafl@debian.org>
87 =head1 COPYRIGHT AND LICENSE
89 Copyright 2007-2009 by Infinity Interactive, Inc.
91 L<http://www.iinteractive.com>
93 This library is free software; you can redistribute it and/or modify
94 it under the same terms as Perl itself.