--- trunk/lib/WebPAC/Config.pm 2006/09/24 15:28:49 681 +++ trunk/lib/WebPAC/Config.pm 2006/09/24 15:28:54 682 @@ -89,6 +89,42 @@ return $self->{config}->{use_indexer} || $default; } +=head2 get + + $config->get('top-level_key'); + +=cut + +sub get { + my $self = shift; + my $what = shift || return; + return $self->{config}->{$what}; +} + +=head2 webpac + +Return C<< config -> webpac >> parts + + my @supported_inputs = $config->webpac('inputs'); + my $inputs_hash = $config->webpac('inputs'); + +=cut + +sub webpac { + my $self = shift; + + $self->_get_logger()->logdie("can't find config->webpac") unless defined( $self->{config}->{webpac} ); + + my $what = shift || return $self->{config}->{webpac}; + + if (wantarray) { + return keys %{ $self->{config}->{webpac}->{$what} }; + } else { + return $self->{config}->{webpac}->{$what}; + } + +} + =head1 AUTHOR Dobrica Pavlinusic, C<< >>