89 |
return $self->{config}->{use_indexer} || $default; |
return $self->{config}->{use_indexer} || $default; |
90 |
} |
} |
91 |
|
|
92 |
|
=head2 get |
93 |
|
|
94 |
|
$config->get('top-level_key'); |
95 |
|
|
96 |
|
=cut |
97 |
|
|
98 |
|
sub get { |
99 |
|
my $self = shift; |
100 |
|
my $what = shift || return; |
101 |
|
return $self->{config}->{$what}; |
102 |
|
} |
103 |
|
|
104 |
|
=head2 webpac |
105 |
|
|
106 |
|
Return C<< config -> webpac >> parts |
107 |
|
|
108 |
|
my @supported_inputs = $config->webpac('inputs'); |
109 |
|
my $inputs_hash = $config->webpac('inputs'); |
110 |
|
|
111 |
|
=cut |
112 |
|
|
113 |
|
sub webpac { |
114 |
|
my $self = shift; |
115 |
|
|
116 |
|
$self->_get_logger()->logdie("can't find config->webpac") unless defined( $self->{config}->{webpac} ); |
117 |
|
|
118 |
|
my $what = shift || return $self->{config}->{webpac}; |
119 |
|
|
120 |
|
if (wantarray) { |
121 |
|
return keys %{ $self->{config}->{webpac}->{$what} }; |
122 |
|
} else { |
123 |
|
return $self->{config}->{webpac}->{$what}; |
124 |
|
} |
125 |
|
|
126 |
|
} |
127 |
|
|
128 |
=head1 AUTHOR |
=head1 AUTHOR |
129 |
|
|
130 |
Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >> |
Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >> |