1MouseX::NativeTraits::CUosdeerReCfo(n3t)ributed Perl DocMuomuesnetXa:t:iNoantiveTraits::CodeRef(3)
2
3
4

NAME

6       MouseX::NativeTraits::CodeRef - Helper trait for CodeRef attributes
7

SYNOPSIS

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

DESCRIPTION

26       This provides operations on coderef attributes.
27

PROVIDED METHODS

29       execute(@args)
30           Calls the coderef with the given args.
31

METHODS

33       meta
34       method_provider_class
35       helper_type
36

SEE ALSO

38       MouseX::NativeTraits
39
40
41
42perl v5.32.0                      2020-07-28  MouseX::NativeTraits::CodeRef(3)
Impressum