1 package Catalyst::IOC::Service::WithAcceptContext;
4 with 'Bread::Board::Service';
6 has accept_context_sub => (
9 default => 'ACCEPT_CONTEXT',
13 my ( $orig, $self, %params ) = @_;
15 my $accept_context_args = delete $params{accept_context_args};
17 my $instance = $self->$orig(%params);
18 my $ac_sub = $self->accept_context_sub;
20 if ( $accept_context_args && $instance->can($ac_sub) ) {
21 return $instance->$ac_sub( @$accept_context_args );
36 Catalyst::Service::WithContext
44 =item B<accept_context_sub>
52 Catalyst Contributors, see Catalyst.pm
56 This library is free software. You can redistribute it and/or modify it under
57 the same terms as Perl itself.