1 package Catalyst::Service::WithContext;
4 # Why is the needed to be loaded?
5 use Bread::Board::Types;
7 with 'Bread::Board::Service';
9 has accept_context_sub => (
12 default => 'ACCEPT_CONTEXT',
16 my ( $orig, $self, %params ) = @_;
18 my $context = delete $params{context};
20 my $instance = $self->$orig(%params);
21 my $ac_sub = $self->accept_context_sub;
23 if ( $instance->can($ac_sub) ) {
24 return $instance->$ac_sub( @$context );
39 Catalyst::Service::WithContext
47 =item B<accept_context_sub>
55 Catalyst Contributors, see Catalyst.pm
59 This library is free software. You can redistribute it and/or modify it under
60 the same terms as Perl itself.