Replace {_body} instance access with calls to _body accessors..
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Controller.pm
index c5e6249..5c2267a 100644 (file)
@@ -9,6 +9,8 @@ use Scalar::Util qw/blessed/;
 use Catalyst::Exception;
 use Catalyst::Utils;
 
+with 'Catalyst::Component::Role::CaptureApp';
+
 has path_prefix =>
     (
      is => 'rw',
@@ -32,10 +34,6 @@ has actions =>
      init_arg => undef,
     );
 
-# isa => 'ClassName|Catalyst' ?
-has _application => (is => 'rw');
-sub _app{ shift->_application(@_) } 
-
 sub BUILD {
     my ($self, $args) = @_;
     my $action  = delete $args->{action}  || {};
@@ -122,15 +120,6 @@ sub _END : Private {
     return !@{ $c->error };
 }
 
-around new => sub {
-    my $orig = shift;
-    my $self = shift;
-    my $app = $_[0];
-    my $new = $self->$orig(@_);
-    $new->_application( $app );
-    return $new;
-};
-
 sub action_for {
     my ( $self, $name ) = @_;
     my $app = ($self->isa('Catalyst') ? $self : $self->_application);