=head1 NAME

Sub::HandlesVia::HandlerLibrary::Code - library of Code-related methods

=head1 SYNOPSIS

  package My::Class {
    use Moo;
    use Sub::HandlesVia;
    use Types::Standard 'CodeRef';
    has attr => (
      is => 'rwp',
      isa => CodeRef,
      handles_via => 'Code',
      handles => {
        'my_execute' => 'execute',
        'my_execute_method' => 'execute_method',
      },
    );
  }

=head1 DESCRIPTION

This is a library of methods for L<Sub::HandlesVia>.

=head1 DELEGATABLE METHODS

=head2 C<< execute( @args ) >>

Calls the coderef, passing it any arguments.

  my $coderef = sub { ... };
  my $object  = My::Class->new( attr => $coderef );
  
  # $coderef->( 1, 2, 3 )
  $object->my_execute( 1, 2, 3 );

=head2 C<< execute_method( @args ) >>

Calls the coderef as if it were a method, passing any arguments.

  my $coderef = sub { ... };
  my $object  = My::Class->new( attr => $coderef );
  
  # $coderef->( $object, 1, 2, 3 )
  $object->my_execute_method( 1, 2, 3 );

=head1 BUGS

Please report any bugs to
L<https://github.com/tobyink/p5-sub-handlesvia/issues>.

=head1 SEE ALSO

L<Sub::HandlesVia>.

=head1 AUTHOR

Toby Inkster E<lt>tobyink@cpan.orgE<gt>.

=head1 COPYRIGHT AND LICENCE

This software is copyright (c) 2020, 2022 by Toby Inkster.

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

=head1 DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

