line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ISC::DHCPd::Config::Class; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Class - Class config parameter |
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 the block below: |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
class "$name" { |
15
|
|
|
|
|
|
|
... |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config/SYNOPSIS>. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
21
|
|
|
21
|
|
13571
|
use Moose; |
|
21
|
|
|
|
|
46
|
|
|
21
|
|
|
|
|
158
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
with 'Net::ISC::DHCPd::Config::Role'; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 name |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Name of the key - See L</DESCRIPTION> for details. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 algorithm |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 secret |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has [qw/ name /] => ( |
41
|
|
|
|
|
|
|
is => 'rw', |
42
|
|
|
|
|
|
|
isa => 'Str', |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 children |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/children>. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
# match will get treated as a KeyValue |
51
|
|
|
|
|
|
|
sub children { |
52
|
21
|
|
|
21
|
1
|
136
|
return qw/ |
53
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::Option |
54
|
|
|
|
|
|
|
Net::ISC::DHCPd::Config::KeyValue |
55
|
|
|
|
|
|
|
/; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
__PACKAGE__->create_children(__PACKAGE__->children()); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 regex |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/regex>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
our $regex = qr{^\s* class \s+ (")?(.*?)(\1|$) }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
|
0
|
|
|
0
|
1
|
|
return { name => $_[1] }; # $_[0] == quote or empty string |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 generate |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd::Config::Role/generate>. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub generate { |
86
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
87
|
0
|
|
|
|
|
|
return sprintf('class "%s" {', $self->name), $self->_generate_config_from_children, '}'; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
See L<Net::ISC::DHCPd>. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
98
|
|
|
|
|
|
|
1; |