overridden WithParameters defaults
André Walker [Mon, 1 Aug 2011 22:58:32 +0000 (19:58 -0300)]
lib/Catalyst/IOC/BlockInjection.pm
lib/Catalyst/IOC/Container.pm
lib/Catalyst/IOC/Service/WithParameters.pm [new file with mode: 0644]

index 00ed4a5..4453e84 100644 (file)
@@ -3,7 +3,7 @@ use Moose;
 extends 'Bread::Board::BlockInjection';
 
 with 'Bread::Board::Service::WithDependencies',
-     'Bread::Board::Service::WithParameters',
+     'Catalyst::IOC::Service::WithParameters',
      'Catalyst::IOC::Service::WithAcceptContext';
 
 __PACKAGE__->meta->make_immutable;
index dde663a..051f758 100644 (file)
@@ -656,12 +656,6 @@ sub add_component {
                 depends_on( '/application_name' ),
                 depends_on( '/config' ),
             ],
-            parameters => {
-                suffix => {
-                    isa => 'Str',
-                    default => Catalyst::Utils::class2classsuffix( $component ),
-                },
-            },
         )
     );
 
@@ -671,13 +665,6 @@ sub add_component {
             dependencies => [
                 depends_on( "/component/$component_service_name" ),
             ],
-            parameters => {
-                accept_context_args => {
-                    isa => 'ArrayRef|Undef',
-                    required => 0,
-                    default => undef,
-                },
-            },
             block => sub { return shift->param($component_service_name) },
         )
     );
diff --git a/lib/Catalyst/IOC/Service/WithParameters.pm b/lib/Catalyst/IOC/Service/WithParameters.pm
new file mode 100644 (file)
index 0000000..44c42f9
--- /dev/null
@@ -0,0 +1,41 @@
+package Catalyst::IOC::Service::WithParameters;
+use Moose::Role;
+
+with 'Bread::Board::Service',
+     'Bread::Board::Service::WithParameters';
+
+sub _build_parameters {
+    return {
+        accept_context_args => {
+            isa      => 'ArrayRef|Undef',
+            required => 0,
+            default  => undef,
+        }
+    };
+}
+
+no Moose::Role;
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Catalyst::IOC::Service::WithParameters
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut