<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Moose::Meta::Attribute::Native::Trait::Code;
our $VERSION = '2.2011';

use Moose::Role;
with 'Moose::Meta::Attribute::Native::Trait';

sub _helper_type { 'CodeRef' }

no Moose::Role;

1;

# ABSTRACT: Helper trait for CodeRef attributes

__END__

=pod

=encoding UTF-8

=head1 NAME

Moose::Meta::Attribute::Native::Trait::Code - Helper trait for CodeRef attributes

=head1 VERSION

version 2.2011

=head1 SYNOPSIS

  package Foo;
  use Moose;

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

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

=head1 DESCRIPTION

This trait provides native delegation methods for code references.

=head1 DEFAULT TYPE

If you don't provide an C&lt;isa&gt; value for your attribute, it will default to
C&lt;CodeRef&gt;.

=head1 PROVIDED METHODS

=over 4

=item * B&lt;execute(@args)&gt;

Calls the coderef with the given args.

=item * B&lt;execute_method(@args)&gt;

Calls the coderef with the instance as invocant and given args.

=back

=head1 BUGS

See L&lt;Moose/BUGS&gt; for details on reporting bugs.

=head1 AUTHORS

=over 4

=item *

Stevan Little &lt;stevan.little@iinteractive.com&gt;

=item *

Dave Rolsky &lt;autarch@urth.org&gt;

=item *

Jesse Luehrs &lt;doy@tozt.net&gt;

=item *

Shawn M Moore &lt;code@sartak.org&gt;

=item *

×™×•×‘×œ ×§×•×’'×ž×Ÿ (Yuval Kogman) &lt;nothingmuch@woobling.org&gt;

=item *

Karen Etheridge &lt;ether@cpan.org&gt;

=item *

Florian Ragwitz &lt;rafl@debian.org&gt;

=item *

Hans Dieter Pearcey &lt;hdp@weftsoar.net&gt;

=item *

Chris Prather &lt;chris@prather.org&gt;

=item *

Matt S Trout &lt;mst@shadowcat.co.uk&gt;

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
</pre></body></html>