File Coverage

blib/lib/MooX/Cmd/ChainedOptions/Role.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             # --8<--8<--8<--8<--
2             #
3             # Copyright (C) 2015 Smithsonian Astrophysical Observatory
4             #
5             # This file is part of MooX-Cmd-ChainedOptions
6             #
7             # MooX-Cmd-ChainedOptions is free software: you can redistribute it and/or modify
8             # it under the terms of the GNU General Public License as published by
9             # the Free Software Foundation, either version 3 of the License, or (at
10             # your option) any later version.
11             #
12             # This program is distributed in the hope that it will be useful,
13             # but WITHOUT ANY WARRANTY; without even the implied warranty of
14             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15             # GNU General Public License for more details.
16             #
17             # You should have received a copy of the GNU General Public License
18             # along with this program. If not, see .
19             #
20             # -->8-->8-->8-->8--
21              
22             package MooX::Cmd::ChainedOptions::Role;
23              
24 2     2   8 use strict;
  2         2  
  2         50  
25 2     2   7 use warnings;
  2         2  
  2         55  
26              
27             use Package::Variant
28 2         10 importing => ['Moo::Role'],
29 2     2   772 subs => [ 'has', 'with' ];
  2         2108  
30              
31             =pod
32              
33             =for pod-coverage
34              
35             =head2 make_variant
36              
37             =cut
38             sub make_variant {
39              
40 4     4 1 2223 my ( $class, $target, $parent, $role ) = @_;
41              
42 4         16 with $role;
43              
44 4         93 has '+_parent' => (
45             is => 'lazy',
46 4         1033 handles => [ keys %{ { $parent->_options_data } } ],
47             );
48              
49             }
50              
51             1;
52              
53             __END__