From: André Walker Date: Thu, 7 Jul 2011 13:58:02 +0000 (-0300) Subject: POD and sensible name for ACCEPT_CONTEXT args X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4f38bf4bf475178576b5fef4c7b19d122e4a1122 POD and sensible name for ACCEPT_CONTEXT args --- diff --git a/lib/Catalyst/Service/WithContext.pm b/lib/Catalyst/Service/WithContext.pm index f3e9499..6f18300 100644 --- a/lib/Catalyst/Service/WithContext.pm +++ b/lib/Catalyst/Service/WithContext.pm @@ -1,9 +1,6 @@ package Catalyst::Service::WithContext; use Moose::Role; -# Why is the needed to be loaded? -use Bread::Board::Types; - with 'Bread::Board::Service'; has accept_context_sub => ( @@ -15,13 +12,13 @@ has accept_context_sub => ( around 'get' => sub { my ( $orig, $self, %params ) = @_; - my $context = delete $params{context}; + my $accept_context_args = delete $params{accept_context_args}; my $instance = $self->$orig(%params); my $ac_sub = $self->accept_context_sub; if ( $instance->can($ac_sub) ) { - return $instance->$ac_sub( @$context ); + return $instance->$ac_sub( @$accept_context_args ); } return $instance; diff --git a/lib/Catalyst/SubContainer.pm b/lib/Catalyst/SubContainer.pm index 6dc29dc..6d58be9 100644 --- a/lib/Catalyst/SubContainer.pm +++ b/lib/Catalyst/SubContainer.pm @@ -7,7 +7,11 @@ extends 'Bread::Board::Container'; sub get_component { my ( $self, $name, $args ) = @_; - return $self->resolve( service => $name, parameters => { context => $args } ); + + return $self->resolve( + service => $name, + parameters => { accept_context_args => $args }, + ); } sub get_component_regexp { @@ -38,3 +42,28 @@ sub get_component_regexp { } 1; + +__END__ + +=pod + +=head1 NAME + +Catalyst::SubContainer - Container for models, controllers and views + +=head1 METHODS + +=head2 get_component + +=head2 get_component_regexp + +=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