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 _default_is { 'ro' }
19 sub _helper_type { 'CodeRef' }
29 Moose::Meta::Attribute::Native::Trait::Code
40 default => sub { sub { print "called" } },
47 $foo->call; # prints "called"
52 This provides operations on coderef attributes.
54 =head1 PROVIDED METHODS
58 =item B<execute(@args)>
60 Calls the coderef with the given args.
70 =item B<method_provider>
72 =item B<has_method_provider>
78 All complex software has bugs lurking in it, and this module is no
79 exception. If you find a bug please either email me, or add the bug
84 Florian Ragwitz <rafl@debian.org>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2007-2009 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.