logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Sub::HandlesVia::HandlerLibrary::Blessed - library of object-related methods

Author

       Toby Inkster <tobyink@cpan.org>.

Bugs

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

Delegatable Methods

       Unlike the other libraries supplied by Sub::HandlesVia, this library allows you to delegate to any method
       name.

       It assumes that the attribute value is a blessed object, and calls the correspondingly named method on
       it.

       Moo, Moose, Mouse, and Mite all have this kind of delegation built-in anyway, but this module allows you
       to perform the delegation using Sub::HandlesVia. This may be useful for Object::Pad and Class::Tiny,
       which don't have a built-in delegation feature.

Description

       This is a library of methods for Sub::HandlesVia.

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.

perl v5.40.1                                       2025-04-01             Sub::HandlesVia...ibrary::Blessed(3pm)

Name

       Sub::HandlesVia::HandlerLibrary::Blessed - library of object-related methods

See Also

       Sub::HandlesVia.

Synopsis

         package My::Class {
           use Moo;
           use Sub::HandlesVia;
           use Types::Standard 'Object';
           use HTTP::Tiny;
           has http_ua => (
             is => 'rwp',
             isa => Object,
             handles_via => 'Blessed',
             handles => {
               'http_get'  => 'get',
               'http_post' => 'post',
             },
             default => sub { HTTP::Tiny->new },
           );
         }

See Also