Commit | Line | Data |
b463fcad |
1 | package TestAppCustomContainer::Role::ACCEPT_CONTEXT; |
2 | use Moose::Role; |
3 | use namespace::autoclean; |
4 | |
5 | has accept_context_called => ( |
6 | traits => ['Counter'], |
7 | isa => 'Int', |
8 | is => 'ro', |
9 | default => 0, |
10 | handles => { |
11 | inc_accept_context_called => 'inc', |
12 | }, |
13 | ); |
14 | |
cd547805 |
15 | sub ACCEPT_CONTEXT {} |
16 | |
17 | around ACCEPT_CONTEXT => sub { |
18 | my ( $orig, $self, $ctx, @args ) = @_; |
b463fcad |
19 | |
20 | $self->inc_accept_context_called; |
21 | |
cd547805 |
22 | return $self->$orig() || $self; |
23 | }; |
b463fcad |
24 | |
25 | 1; |