From: John Napiorkowski Date: Fri, 18 Jul 2014 22:17:52 +0000 (-0400) Subject: tweak stash method names a bit X-Git-Tag: 5.90070~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=e77ad76e30c334b05bdef6cc5e5ef57304d8c309 tweak stash method names a bit --- diff --git a/lib/Catalyst/Middleware/Stash.pm b/lib/Catalyst/Middleware/Stash.pm index 7102089..f3bbe68 100644 --- a/lib/Catalyst/Middleware/Stash.pm +++ b/lib/Catalyst/Middleware/Stash.pm @@ -14,7 +14,7 @@ sub PSGI_KEY { 'Catalyst.Stash.v1' }; sub get_stash { my $env = shift; return $env->{PSGI_KEY} || - _init_stash($env); + _init_stash_in($env); } sub stash { @@ -23,7 +23,7 @@ sub stash { ->(@args); } -sub _generate_stash_closure { +sub _create_stash { my $stash = shift || +{}; return sub { if(@_) { @@ -38,15 +38,15 @@ sub _generate_stash_closure { }; } -sub _init_stash { +sub _init_stash_in { my ($env) = @_; return $env->{PSGI_KEY} ||= - _generate_stash_closure; + _create_stash; } sub call { my ($self, $env) = @_; - _init_stash($env); + _init_stash_in($env); return $self->app->($env); } @@ -79,8 +79,7 @@ Expect: $psgi_env. Exportable subroutine. -Get the stash out of the C<$env>. If the stash does not yet exist, we initialize -one and return that. +Get the stash out of the C<$env>. =head2 stash