1 package TestApp::View::Dump;
4 use base 'Catalyst::View';
7 use Scalar::Util qw(blessed weaken);
10 my ( $self, $reference ) = @_;
12 return unless $reference;
14 my $dumper = Data::Dumper->new( [$reference] );
19 $dumper->Quotekeys(0);
26 my ( $self, $c, $reference ) = @_;
28 # Force processing of on-demand data
31 # Remove body from reference if needed
32 $reference->{__body_type} = blessed $reference->body
33 if (blessed $reference->{_body});
34 my $body = delete $reference->{_body};
36 # Remove context from reference if needed
37 my $context = delete $reference->{_context};
40 $self->dump( $reference ) )
43 $c->res->headers->content_type('text/plain');
44 $c->res->output($output);
48 $reference->{_context} = $context;
49 weaken( $reference->{_context} );
54 delete $reference->{__body_type};
55 $reference->{_body} = $body;