Commit | Line | Data |
fff0a09d |
1 | package MooseX::UndefTolerant::ApplicationToRole; |
2 | use Moose::Role; |
3 | |
4 | around apply => sub { |
5 | my $orig = shift; |
6 | my $self = shift; |
6095de21 |
7 | my ($role1, $role2) = @_; |
fff0a09d |
8 | |
6095de21 |
9 | $role2 = Moose::Util::MetaRole::apply_metaroles( |
10 | for => $role2, |
fff0a09d |
11 | role_metaroles => { |
12 | application_to_class => [ |
13 | 'MooseX::UndefTolerant::ApplicationToClass', |
14 | ], |
15 | application_to_role => [ |
16 | 'MooseX::UndefTolerant::ApplicationToRole', |
17 | ], |
18 | } |
19 | ); |
20 | |
6095de21 |
21 | $self->$orig( $role1, $role2 ); |
fff0a09d |
22 | }; |
23 | |
24 | no Moose::Role; |
25 | |
26 | 1; |