1MouseX::NativeTraits::CUosdeerReCfo(n3t)ributed Perl DocMuomuesnetXa:t:iNoantiveTraits::CodeRef(3)
2
3
4
6 MouseX::NativeTraits::CodeRef - Helper trait for CodeRef attributes
7
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
26 This provides operations on coderef attributes.
27
29 execute(@args)
30 Calls the coderef with the given args.
31
33 meta
34 method_provider_class
35 helper_type
36
38 MouseX::NativeTraits
39
40
41
42perl v5.34.0 2021-07-22 MouseX::NativeTraits::CodeRef(3)