From: André Walker Date: Sat, 23 Jul 2011 22:02:12 +0000 (-0300) Subject: ditto X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eea0c6e27ff029024bd7352064eb033e9758cd81;hp=a01462969571a661338cc581f4dfe85f018d57e0;p=catagits%2FCatalyst-Runtime.git ditto --- diff --git a/lib/Catalyst/IOC/SubContainer.pm b/lib/Catalyst/IOC/SubContainer.pm index afa8e3f..3c2c434 100644 --- a/lib/Catalyst/IOC/SubContainer.pm +++ b/lib/Catalyst/IOC/SubContainer.pm @@ -6,8 +6,8 @@ use Catalyst::IOC::BlockInjection; extends 'Bread::Board::Container'; has default_component => ( - isa => 'Str|Undef', - is => 'ro', + isa => 'Str|Undef', + is => 'ro', required => 0, writer => '_set_default_component', ); @@ -31,7 +31,8 @@ sub get_component_regexp { return @result; } -# FIXME: not the best name for a sub +# FIXME - is this sub ok? +# is the name ok too? sub make_single_default { my ( $self ) = @_; @@ -55,10 +56,16 @@ Catalyst::IOC::SubContainer - Container for models, controllers and views =head2 get_component +Gets the service of the container for the searched component. Also executes the ACCEPT_CONTEXT sub in the component, if it exists. + =head2 get_component_regexp +Gets all components from container that match a given regexp. + =head2 make_single_default +If the container has only one component, and no default has been defined, this method makes that one existing service the default. + =head1 AUTHORS Catalyst Contributors, see Catalyst.pm