1Moose::Meta::Attribute:U:sNeartiCvoen:t:rTiMrboauoitstee:d:::CPMoeedrtela(:3D:)oActutmreinbtuattei:o:nNative::Trait::Code(3)
2
3
4

NAME

6       Moose::Meta::Attribute::Native::Trait::Code - Helper trait for Code
7       attributes
8

SYNOPSIS

10         package Foo;
11         use Moose;
12
13         has 'callback' => (
14             traits    => ['Code'],
15             is        => 'ro',
16             isa       => 'CodeRef',
17             default   => sub { sub { print "called" } },
18             handles   => {
19                 call => 'execute',
20             },
21         );
22
23         my $foo = Foo->new;
24         $foo->call; # prints "called"
25

DESCRIPTION

27       This provides operations on coderef attributes.
28

PROVIDED METHODS

30       execute(@args)
31           Calls the coderef with the given args.
32
33       execute_method(@args)
34           Calls the coderef with the the instance as invocant and given args.
35

METHODS

37       meta
38       method_provider
39       has_method_provider
40

BUGS

42       See "BUGS" in Moose for details on reporting bugs.
43

AUTHOR

45         Florian Ragwitz <rafl@debian.org>
46
48       Copyright 2007-2009 by Infinity Interactive, Inc.
49
50       <http://www.iinteractive.com>
51
52       This library is free software; you can redistribute it and/or modify it
53       under the same terms as Perl itself.
54
55
56
57perl v5.12.2                    Mo2o0s1e0:-:0M8e-t2a8::Attribute::Native::Trait::Code(3)
Impressum