line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::SingleArg::Meta::ToRole; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$MooseX::SingleArg::Meta::ToRole::VERSION = '0.09'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4986
|
use Moose::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
around apply => sub{ |
8
|
|
|
|
|
|
|
my $orig = shift; |
9
|
|
|
|
|
|
|
my $self = shift; |
10
|
|
|
|
|
|
|
my $from_role = shift; |
11
|
|
|
|
|
|
|
my $to_role = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$to_role = Moose::Util::MetaRole::apply_metaroles( |
14
|
|
|
|
|
|
|
for => $to_role, |
15
|
|
|
|
|
|
|
role_metaroles => { |
16
|
|
|
|
|
|
|
role => ['MooseX::SingleArg::Meta::Role'], |
17
|
|
|
|
|
|
|
application_to_class => ['MooseX::SingleArg::Meta::ToClass'], |
18
|
|
|
|
|
|
|
application_to_role => ['MooseX::SingleArg::Meta::ToRole'], |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$to_role->single_arg( $from_role->single_arg() ) if $from_role->has_single_arg(); |
23
|
|
|
|
|
|
|
$to_role->force_single_arg( $from_role->force_single_arg() ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return $self->$orig( $from_role, $to_role ); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |