Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MouseX::NativeTraits::UserRContributed Perl DoMouseX::NativeTraits::CodeRef(3)

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

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"

DESCRIPTION
       This provides operations	on coderef attributes.

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

METHODS
       meta
       method_provider_class
       helper_type

SEE ALSO
       MouseX::NativeTraits

perl v5.32.0			  2012-11-26  MouseX::NativeTraits::CodeRef(3)

NAME | SYNOPSIS | DESCRIPTION | PROVIDED METHODS | METHODS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=MouseX::NativeTraits::CodeRef&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help