use base qw/Class::Accessor::Fast Class::Data::Inheritable/;
use NEXT;
-__PACKAGE__->mk_classdata($_) for qw/_config/;
+__PACKAGE__->mk_classdata($_) for qw/_config _plugins/;
=head1 NAME
sub config {
my $self = shift;
- $self->_config( {} ) unless $self->_config;
+ my $config = $self->_config;
+ unless ($config) {
+ $self->_config( $config = {} );
+ }
if (@_) {
- my $config = @_ > 1 ? {@_} : $_[0];
- while ( my ( $key, $val ) = each %$config ) {
- $self->_config->{$key} = $val;
- }
+ $config = { %{$config}, %{@_ > 1 ? {@_} : $_[0]} };
+ $self->_config($config);
}
- return $self->_config;
+ return $config;
}
=head2 $c->process()