blib/lib/Net/ISC/DHCPd/Config/Function.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 23 SCAR 6.9
CC
1
Cov
0%
children
2.0
captured_to_args
2.0
generate
2.0
CRAP 2.0
1 package Net::ISC::DHCPd::Config::Function;
2  
3 =head1 NAME
4  
5 Net::ISC::DHCPd::Config::Function - Function config parameters
6  
7 =head1 DESCRIPTION
8  
9 See L<Net::ISC::DHCPd::Config::Role> for methods and attributes without
10 documentation.
11  
12 An instance from this class, comes from / will produce:
13  
14 on $name_attribute_value {
15 option_attribute;
16 keyvalue_attribute;
17 if conditional {
18 }
19 }
20  
21 =head1 SYNOPSIS
22  
23 See L<Net::ISC::DHCPd::Config/SYNOPSIS>.
24  
25 =cut
26  
27 use Moose;
28 with 'Net::ISC::DHCPd::Config::Role';
29  
30 use Net::ISC::DHCPd::Config;
31  
32 =head1 ATTRIBUTES
33  
34 =head2 children
35  
36 See L<Net::ISC::DHCPd::Config::Role/children>.
37  
38 =cut
39  
40 sub children {
41 return Net::ISC::DHCPd::Config::children();
42 }
43 __PACKAGE__->create_children(__PACKAGE__->children());
44  
45  
46 =head2 name
47  
48 This attribute holds a plain string, representing the name
49 of the function. Example: "commit".
50  
51 =cut
52  
53 has name => (
54 is => 'ro',
55 isa => 'Str',
56 );
57  
58  
59 =head2 regex
60  
61 See L<Net::ISC::DHCPd::Config::Role/regex>.
62  
63 =cut
64  
65 our $regex = qr{^\s* on \s+ (\w+)}x;
66  
67 =head1 METHODS
68  
69 =head2 captured_to_args
70  
71 See L<Net::ISC::DHCPd::Config::Role/captured_to_args>.
72  
73 =cut
74  
75 sub captured_to_args {
76 return { name => $_[0] }
77 }
78  
79 =head2 generate
80  
81 See L<Net::ISC::DHCPd::Config::Role/generate>.
82  
83 =cut
84  
85 sub generate {
86 my $self = shift;
87  
88 return(
89 'on ' .$self->name .' {',
90 $self->_generate_config_from_children,
91 '}',
92 );
93 }
94  
95 =head1 COPYRIGHT & LICENSE
96  
97 =head1 AUTHOR
98  
99 See L<Net::ISC::DHCPd>.
100  
101 =cut
102 __PACKAGE__->meta->make_immutable;
103 1;