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