14 |
|
|
15 |
=head1 VERSION |
=head1 VERSION |
16 |
|
|
17 |
Version 0.01 |
Version 0.02 |
18 |
|
|
19 |
=cut |
=cut |
20 |
|
|
21 |
our $VERSION = '0.01'; |
our $VERSION = '0.02'; |
22 |
|
|
23 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
24 |
|
|
92 |
|
|
93 |
sub use_indexer { |
sub use_indexer { |
94 |
my $self = shift; |
my $self = shift; |
|
my $default = 'hyperestraier'; |
|
95 |
return unless ($self->{config}); |
return unless ($self->{config}); |
96 |
return $self->{config}->{use_indexer} || $default; |
return $self->{config}->{use_indexer} || undef; |
97 |
} |
} |
98 |
|
|
99 |
=head2 get |
=head2 get |
135 |
=head2 iterate_inputs |
=head2 iterate_inputs |
136 |
|
|
137 |
$config->iterate_inputs( sub { |
$config->iterate_inputs( sub { |
138 |
my $input = shift; |
my ($input, $database, $database_config_hash) = @_; |
139 |
# ... do something with input config hash |
# ... do something with input config hash |
140 |
} ); |
} ); |
141 |
|
|
142 |
|
This function will also modify C<< $input->{normalize} >> to |
143 |
|
be C<ARRAY>, even with just one element. |
144 |
|
|
145 |
=cut |
=cut |
146 |
|
|
147 |
sub iterate_inputs { |
sub iterate_inputs { |
164 |
|
|
165 |
foreach my $input (@inputs) { |
foreach my $input (@inputs) { |
166 |
$log->debug("iterating over input ", dump($input)); |
$log->debug("iterating over input ", dump($input)); |
167 |
$code_ref->($input); |
if ( defined( $input->{normalize} ) && ref($input->{normalize}) ne 'ARRAY' ) { |
168 |
|
$input->{normalize} = [ $input->{normalize} ]; |
169 |
|
} |
170 |
|
$code_ref->($input, $database, $db_config); |
171 |
} |
} |
172 |
} |
} |
173 |
|
|