藤 吾郎 > MouseX-NativeTraits-1.08 > MouseX::NativeTraits::CodeRef

Download:
MouseX-NativeTraits-1.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source   Latest Release: MouseX-NativeTraits-1.09

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

syntax highlighting: