logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Description

       This provides operations on coderef attributes.

Methods

metamethod_provider_classhelper_type

Name

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

Provided Methods

execute(@args)
           Calls the coderef with the given args.

See Also

       MouseX::NativeTraits

perl v5.34.0                                       2022-06-16                 MouseX::NativeTraits::CodeRef(3pm)

Synopsis

         package Foo;
         use Mouse;

         has 'callback' => (
             traits    => ['Code'],
             is        => 'ro',
             isa       => 'CodeRef',
             default   => sub { sub { print "called" } },
             handles   => {
                 call => 'execute',
             },
         );

         my $foo = Foo->new;
         $foo->call; # prints "called"

See Also