small fixes in POD
[catagits/Catalyst-Runtime.git] / lib / Catalyst / IOC / ConstructorInjection.pm
CommitLineData
b7da37bd 1package Catalyst::IOC::ConstructorInjection;
2use Moose;
3extends 'Bread::Board::ConstructorInjection';
4
bf142143 5with 'Bread::Board::Service::WithClass',
6 'Bread::Board::Service::WithDependencies',
7 'Bread::Board::Service::WithParameters',
637cebbe 8 'Catalyst::IOC::Service::WithCOMPONENT',
bf142143 9 'Catalyst::IOC::Service::WithAcceptContext';
b7da37bd 10
637cebbe 11# FIXME - how much of this should move to ::WithCOMPONENT?
b7da37bd 12sub get {
13 my $self = shift;
14
15 my $constructor = $self->constructor_name;
b7da37bd 16 my $component = $self->class;
bf142143 17 my $params = $self->params;
18 my $config = $params->{config}->{ $self->param('suffix') } || {};
19 my $app_name = $params->{application_name};
b7da37bd 20
b7da37bd 21 # Stash catalyst_component_name in the config here, so that custom COMPONENT
22 # methods also pass it. local to avoid pointlessly shitting in config
23 # for the debug screen, as $component is already the key name.
bf142143 24 local $config->{catalyst_component_name} = $component;
b7da37bd 25
637cebbe 26 return $component->$constructor( $app_name, $config );
b7da37bd 27}
28
29__PACKAGE__->meta->make_immutable;
30
31no Moose; 1;
32
33__END__
34
35=pod
36
37=head1 NAME
38
1ab07ed4 39Catalyst::IOC::ConstructorInjection
40
41=head1 SYNOPSIS
42
43=head1 DESCRIPTION
b7da37bd 44
45=head1 AUTHORS
46
47Catalyst Contributors, see Catalyst.pm
48
49=head1 COPYRIGHT
50
51This library is free software. You can redistribute it and/or modify it under
52the same terms as Perl itself.
53
54=cut