Refactor capturing of $app from ::Controller into ::Component::Role::CaptureApp for...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Component / Role / CaptureApp.pm
CommitLineData
9cc543bc 1package Catalyst::Component::Role::CaptureApp;
2
3use Moose::Role;
4use namespace::clean -except => 'meta';
5
6# Future - isa => 'ClassName|Catalyst' performance?
7# required => 1 breaks tests..
8has _application => (is => 'ro');
9sub _app { (shift)->_application(@_) }
10
11override BUILDARGS => sub {
12 my ($self, $app) = @_;
13
14 my $args = super();
15 $args->{_application} = $app;
16
17 return $args;
18};
19
201;