| 1 | package Net::ISC::DHCPd::Config::Root; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Net::ISC::DHCPd::Config::Root - Role for root config classes | ||
| 6 | |||
| 7 | =head1 DESCRIPTION | ||
| 8 | |||
| 9 | This role is applied to root classes, such as L<Net::ISC::DHCPd::Config> | ||
| 10 | and L<Net::ISC::DHCPd::Config::Include>. | ||
| 11 | |||
| 12 | =cut | ||
| 13 | |||
| 14 | 27 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 27 | ▶ | use MooseX::Types::Path::Class 0.05 qw(File); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 27 | with 'Net::ISC::DHCPd::Config::Role'; | |
| 18 | |||
| 19 | =head1 ATTRIBUTES | ||
| 20 | |||
| 21 | =head2 file | ||
| 22 | |||
| 23 | This attribute holds a L<Path::Class::File> object representing | ||
| 24 | path to a config file. Default value is "/etc/dhcp3/dhcpd.conf". | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | |||
| 29 | 27 | has fh => ( | |
| 30 | is => 'rw', | ||
| 31 | isa => 'FileHandle', | ||
| 32 | required => 0, | ||
| 33 | ); | ||
| 34 | |||
| 35 | has file => ( | ||
| 36 | is => 'rw', | ||
| 37 | isa => File, | ||
| 38 | coerce => 1, | ||
| 39 | 18 | ▶ | default => sub { Path::Class::File->new('', 'etc', 'dhcp3', 'dhcpd.conf') }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 40 | 27 | ); | |
| 41 | |||
| 42 | =head1 METHODS | ||
| 43 | |||
| 44 | =head2 generate | ||
| 45 | |||
| 46 | Will use L<Net::ISC::DHCPd::Config::Role/generate_config_from_children> | ||
| 47 | to convert the object graph into text. | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | 17 | ▶ | sub generate { |
|
Subroutine
generate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 52 | 17 | shift->generate_config_from_children ."\n"; | |
| 53 | } | ||
| 54 | |||
| 55 | =head1 COPYRIGHT & LICENSE | ||
| 56 | |||
| 57 | =head1 AUTHOR | ||
| 58 | |||
| 59 | See L<Net::ISC::DHCPd>. | ||
| 60 | |||
| 61 | =cut | ||
| 62 | |||
| 63 | 27 | 1; | |