use Modern::Perl;
-use Module::Load::Conditional qw(can_load);
+use Module::Load::Conditional qw( can_load );
use Module::Pluggable::Object;
use base qw(Class::Accessor);
return $self;
}
+=head3 options
+
+ $processor->options( $new_options );
+
+Overloaded accessor, that spreads the new options to the filter objects when set
+
+=cut
+
+sub options {
+ my ( $self, $options ) = @_;
+
+ if ( $options ) { # Set
+ foreach my $filter ( @{$self->filters} ) {
+ $filter->params->{options} = $options;
+ }
+
+ $self->{options} = $options;
+ return $self;
+ }
+
+ return $self->{options};
+}
+
=head2 bind
$normalizer->bind($record)
return unless defined $record;
- my $newrecord = $record;
-
foreach my $filterobj (@{$self->filters}) {
next unless $filterobj;
- $newrecord = $filterobj->filter($newrecord);
+ $filterobj->filter($record);
}
- return $newrecord;
+ return $record;
}
sub DESTROY {