JSORB::Dispatcher::Traits::WithInvocant - A dispatcher trait for invocants


JSORB documentation Contained in the JSORB distribution.

Index


Code Index:

NAME

Top

JSORB::Dispatcher::Traits::WithInvocant - A dispatcher trait for invocants

DESCRIPTION

Top

This is a dispatcher trait that expects a object invocant as the first argument. It can only be used with JSORB::Method and not JSORB::Procedure.

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE

Top


JSORB documentation Contained in the JSORB distribution.

package JSORB::Dispatcher::Traits::WithInvocant;
use Moose::Role;

our $VERSION   = '0.04';
our $AUTHORITY = 'cpan:STEVAN';

before 'call_procedure' => sub {
    my ($self, $procedure) = @_;
    ($procedure->isa('JSORB::Method'))
        || confess "Procedure must be a JSORB::Method, not a $procedure";    
};

around 'assemble_params_list' => sub {
    my $next = shift;
    my ($self, $call, $invocant, @args) = @_;
    return ($invocant, $self->$next( $call, @args ));    
};

no Moose::Role; 1;

__END__