From 61fa7917ab15e46892211f712e554eaccf8857fb Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 2 Sep 2013 10:50:19 -0400 Subject: add Web::Response->to_app (backported from Plack e3d0dde) --- lib/Web/Response.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/Web/Response.pm b/lib/Web/Response.pm index ae22bc0..f9d0bb5 100644 --- a/lib/Web/Response.pm +++ b/lib/Web/Response.pm @@ -158,6 +158,11 @@ sub finalize { }); } +sub to_app { + my $self = shift; + return sub { $self->finalize }; +} + sub _finalize_streaming { my $self = shift; @@ -360,6 +365,11 @@ Returns a valid L response, based on the values given. This can be either an arrayref or a coderef, depending on if an immediate or streaming response was provided. If both were provided, the streaming response will be preferred. +=method to_app + +Returns a PSGI application which just returns the response in this object +directly. + =cut 1; -- cgit v1.2.3-54-g00ecf