MouseX::NativeTraits::CodeRef(3pm)

MouseX::NativeTraits::CodeRef3pm

Helper trait for coderef attributes

Usage

  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"

Overview

This provides operations on coderef attributes.

Provided methods

execute(@args)

Calls the coderef with the given args.

Methods

meta
method_provider_class
helper_type

Releases

7 releases since Debian 7 (Wheezy); the text changed 3 times.

  1. 7
  2. 8–10
  3. 11
  4. 12–13

From libmousex-nativetraits-perl 1.09-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.