Skip to content

Commit

Permalink
use more concise method descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 7, 2014
1 parent e704f47 commit 788449e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 54 deletions.
24 changes: 11 additions & 13 deletions lib/Mojo/Message.pm
Expand Up @@ -461,9 +461,9 @@ Render start line.
my ($foo, $bar) = $msg->cookie(['foo', 'bar']);
Access message cookies, usually L<Mojo::Cookie::Request> or
L<Mojo::Cookie::Response> objects. To access more than one cookie you can also
use L</"every_cookie">. Note that this method caches all data, so it should
not be called before all headers have been received.
L<Mojo::Cookie::Response> objects. To access multiple cookies sharing the same
name you can also use L</"every_cookie">. Note that this method caches all
data, so it should not be called before all headers have been received.
# Get cookie value
say $msg->cookie('foo')->value;
Expand Down Expand Up @@ -505,10 +505,9 @@ error.
my $cookies = $msg->every_cookie('foo');
Access all message cookies with the same name, usually
L<Mojo::Cookie::Request> or L<Mojo::Cookie::Response> objects. To access only
one cookie you can also use L</"cookie">. Note that this method caches all
data, so it should not be called before all headers have been received.
Similar to L</"cookie">, but returns all message cookies sharing the same name
as an array reference. Note that this method caches all data, so it should not
be called before all headers have been received.
# Get first cookie value
say $msg->every_cookie('foo')->[0]->value;
Expand All @@ -517,9 +516,8 @@ data, so it should not be called before all headers have been received.
my $uploads = $msg->every_upload('foo');
Access all C<multipart/form-data> file uploads with the same name, usually
L<Mojo::Upload> objects. To access only one upload you can also use
L</"upload">. Note that this method caches all data, so it should not be
Similar to L</"upload">, but returns all file uploads sharing the same name as
an array reference. Note that this method caches all data, so it should not be
called before the entire message body has been received.
# Get content of first uploaded file
Expand Down Expand Up @@ -634,9 +632,9 @@ Render whole message.
my ($foo, $bar) = $msg->upload(['foo', 'bar']);
Access C<multipart/form-data> file uploads, usually L<Mojo::Upload> objects.
To access more than one upload you can also use L</"every_upload">. Note that
this method caches all data, so it should not be called before the entire
message body has been received.
To access multiple uploads sharing the same name you can also use
L</"every_upload">. Note that this method caches all data, so it should not be
called before the entire message body has been received.
# Get content of uploaded file
say $msg->upload('foo')->asset->slurp;
Expand Down
22 changes: 10 additions & 12 deletions lib/Mojo/Message/Request.pm
Expand Up @@ -357,13 +357,11 @@ Access request cookies, usually L<Mojo::Cookie::Request> objects.
my $values = $req->every_param('foo');
Access all C<GET> and C<POST> parameters with the same name extracted from the
query string and C<application/x-www-form-urlencoded> or
C<multipart/form-data> message body. To access only one value you can also use
L</"param">. Note that this method caches all data, so it should not be called
before the entire request body has been received. Parts of the request body
need to be loaded into memory to parse C<POST> parameters, so you have to make
sure it is not excessively large, there's a 10MB limit by default.
Similar to L</"param">, but returns all values sharing the same name as an
array reference. Note that this method caches all data, so it should not be
called before the entire request body has been received. Parts of the request
body need to be loaded into memory to parse C<POST> parameters, so you have to
make sure it is not excessively large, there's a 10MB limit by default.
# Get first value
say $req->every_param('foo')->[0];
Expand Down Expand Up @@ -412,11 +410,11 @@ Check C<X-Requested-With> header for C<XMLHttpRequest> value.
Access C<GET> and C<POST> parameters extracted from the query string and
C<application/x-www-form-urlencoded> or C<multipart/form-data> message body.
To access more than one value you can also use L</"every_param">. Note that
this method caches all data, so it should not be called before the entire
request body has been received. Parts of the request body need to be loaded
into memory to parse C<POST> parameters, so you have to make sure it is not
excessively large, there's a 10MB limit by default.
To access multiple values sharing the same name you can also use
L</"every_param">. Note that this method caches all data, so it should not be
called before the entire request body has been received. Parts of the request
body need to be loaded into memory to parse C<POST> parameters, so you have to
make sure it is not excessively large, there's a 10MB limit by default.
=head2 params
Expand Down
9 changes: 5 additions & 4 deletions lib/Mojo/Parameters.pm
Expand Up @@ -256,8 +256,8 @@ Clone parameters.
my $values = $params->every_param('foo');
Access all parameter values with the same name. To access only one value you
can also use L</"param">. Note that this method will normalize the parameters.
Similar to L</"param">, but returns all values sharing the same name as an
array reference. Note that this method will normalize the parameters.
# Get first value
say $params->every_param('foo')->[0];
Expand Down Expand Up @@ -289,8 +289,9 @@ necessary.
$params = $params->param(foo => qw(ba&r baz));
$params = $params->param(foo => ['ba;r', 'baz']);
Access parameter values. To access more than one value you can also use
L</"every_param">. Note that this method will normalize the parameters.
Access parameter values. To access multiple values sharing the same name you
can also use L</"every_param">. Note that this method will normalize the
parameters.
=head2 params
Expand Down
37 changes: 17 additions & 20 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -498,8 +498,8 @@ Continue dispatch chain with L<Mojolicious::Routes/"continue">.
$c = $c->cookie(foo => 'bar');
$c = $c->cookie(foo => 'bar', {path => '/'});
Access request cookie values and create new response cookies. To access more
than one cookie you can also use L</"every_cookie">.
Access request cookie values and create new response cookies. To access
multiple values sharing the same name you can also use L</"every_cookie">.
# Create response cookie with domain and expiration date
$c->cookie(user => 'sri', {domain => 'example.com', expires => time + 60});
Expand All @@ -508,8 +508,8 @@ than one cookie you can also use L</"every_cookie">.
my $values = $c->every_cookie('foo');
Access all request cookie values with the same name. To access only one cookie
you can also use L</"cookie">.
Similar to L</"cookie">, but returns all request cookie values sharing the
same name as an array reference.
$ Get first cookie value
my $first = $c->every_cookie('foo')->[0];
Expand All @@ -518,13 +518,10 @@ you can also use L</"cookie">.
my $values = $c->every_param('foo');
Access all route placeholder values that are not reserved stash values, file
uploads as well as C<GET> and C<POST> parameters with the same name extracted
from the query string and C<application/x-www-form-urlencoded> or
C<multipart/form-data> message body, in that order. To access only one value
you can also use L</"param">. Parts of the request body need to be loaded into
memory to parse C<POST> parameters, so you have to make sure it is not
excessively large, there's a 10MB limit by default.
Similar to L</"param">, but returns all values sharing the same name as an
array reference. Parts of the request body need to be loaded into memory to
parse C<POST> parameters, so you have to make sure it is not excessively
large, there's a 10MB limit by default.
# Get first value
my $first = $c->every_param('foo')->[0];
Expand All @@ -533,8 +530,8 @@ excessively large, there's a 10MB limit by default.
my $values = $c->every_signed_cookie('foo');
Access all signed request cookie values with the same name. To access only one
signed cookie you can also use L</"signed_cookie">.
Similar to L</"signed_cookie">, but returns all signed request cookie values
sharing the same name as an array reference.
# Get first signed cookie value
my $first = $c->every_signed_cookie('foo')->[0];
Expand Down Expand Up @@ -618,10 +615,10 @@ status.
Access route placeholder values that are not reserved stash values, file
uploads as well as C<GET> and C<POST> parameters extracted from the query
string and C<application/x-www-form-urlencoded> or C<multipart/form-data>
message body, in that order. To access more than one value you can also use
L</"every_param">. Parts of the request body need to be loaded into memory to
parse C<POST> parameters, so you have to make sure it is not excessively
large, there's a 10MB limit by default.
message body, in that order. To access multiple values sharing the same name
you can also use L</"every_param">. Parts of the request body need to be
loaded into memory to parse C<POST> parameters, so you have to make sure it is
not excessively large, there's a 10MB limit by default.
# Get first value
my $first = $c->every_param('foo')->[0];
Expand Down Expand Up @@ -886,9 +883,9 @@ on browser.
$c = $c->signed_cookie(foo => 'bar', {path => '/'});
Access signed request cookie values and create new signed response cookies. To
access more than one signed cookie you can also use L</"every_signed_cookie">.
Cookies failing HMAC-SHA1 signature verification will be automatically
discarded.
access multiple values sharing the same name you can also use
L</"every_signed_cookie">. Cookies failing HMAC-SHA1 signature verification
will be automatically discarded.
=head2 stash
Expand Down
9 changes: 4 additions & 5 deletions lib/Mojolicious/Validator/Validation.pm
Expand Up @@ -193,9 +193,8 @@ only be one per field.
my $values = $validation->every_param('foo');
Access all validated parameters with the same name, similar to
L<Mojolicious::Controller/"every_param">. To access only one value you can
also use L</"param">.
Similar to L</"param">, but returns all values sharing the same name as an
array reference.
# Get first value
my $first = $validation->every_param('foo')->[0];
Expand Down Expand Up @@ -233,8 +232,8 @@ Change validation L</"topic">.
my $value = $validation->param('foo');
my ($foo, $bar) = $validation->param(['foo', 'bar']);
Access validated parameters, similar to L<Mojolicious::Controller/"param">. To
access more than one value you can also use L</"every_param">.
Access validated parameters. To access multiple values sharing the same name
you can also use L</"every_param">.
=head2 required
Expand Down

0 comments on commit 788449e

Please sign in to comment.