| 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 | 27 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | 27 | with 'Net::ISC::DHCPd::Config::Role'; | |
| 29 | |||
| 30 | 27 | ▶ | use Net::ISC::DHCPd::Config; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | =head1 ATTRIBUTES | ||
| 33 | |||
| 34 | =head2 children | ||
| 35 | |||
| 36 | See L<Net::ISC::DHCPd::Config::Role/children>. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | 34 | ▶ | sub children { |
|
Subroutine
children: called CC=1 SCAR=0.0
Pod
documented
| |||
| 41 | 34 | return Net::ISC::DHCPd::Config::children(); | |
| 42 | } | ||
| 43 | 27 | __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 | 27 | 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 | 27 | 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 | 3 | ▶ | sub captured_to_args { |
|
Subroutine
captured_to_args: called CC=1 SCAR=0.0
Pod
documented
| |||
| 76 | 3 | return { name => $_[0] } | |
| 77 | } | ||
| 78 | |||
| 79 | =head2 generate | ||
| 80 | |||
| 81 | See L<Net::ISC::DHCPd::Config::Role/generate>. | ||
| 82 | |||
| 83 | =cut | ||
| 84 | |||
| 85 | 1 | ▶ | sub generate { |
|
Subroutine
generate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 86 | 1 | my $self = shift; | |
| 87 | |||
| 88 | return( | ||
| 89 | 1 | '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 | 27 | __PACKAGE__->meta->make_immutable; | |
| 103 | 27 | 1; | |