Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better descriptions for a few collection methods
  • Loading branch information
kraih committed Jul 25, 2013
1 parent d476cd4 commit ffdc824
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,4 +1,6 @@

4.20 2013-07-25

4.19 2013-07-21
- Improved invalid tag handling in Mojo::DOM::HTML.

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Base.pm
Expand Up @@ -219,7 +219,7 @@ argument.
$object = $object->tap(sub {...});
K combinator, tap into a method chain to perform operations on an object
within the chain. The object will be the first argument passed to the closure
within the chain. The object will be the first argument passed to the callback
and is also available as C<$_>.
=head1 DEBUGGING
Expand Down
12 changes: 8 additions & 4 deletions lib/Mojo/Collection.pm
Expand Up @@ -135,7 +135,8 @@ Construct a new array-based L<Mojo::Collection> object.
my @elements = $collection->each;
$collection = $collection->each(sub {...});
Evaluate callback for each element in collection.
Evaluate callback for each element in collection. The element will be the
first argument passed to the callback and is also available as C<$_>.
$collection->each(sub {
my ($e, $count) = @_;
Expand All @@ -150,7 +151,8 @@ Evaluate callback for each element in collection.
Evaluate regular expression or callback for each element in collection and
return the first one that matched the regular expression, or for which the
callback returned true.
callback returned true. The element will be the first argument passed to the
callback and is also available as C<$_>.
my $five = $collection->first(sub { $_ == 5 });
Expand All @@ -161,7 +163,8 @@ callback returned true.
Evaluate regular expression or callback for each element in collection and
create a new collection with all elements that matched the regular expression,
or for which the callback returned true.
or for which the callback returned true. The element will be the first
argument passed to the callback and is also available as C<$_>.
my $interesting = $collection->grep(qr/mojo/i);
Expand All @@ -178,7 +181,8 @@ Turn collection into L<Mojo::ByteStream>.
my $new = $collection->map(sub {...});
Evaluate callback for each element in collection and create a new collection
from the results.
from the results. The element will be the first argument passed to the
callback and is also available as C<$_>.
my $doubled = $collection->map(sub { $_ * 2 });
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -41,7 +41,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Top Hat';
our $VERSION = '4.19';
our $VERSION = '4.20';

sub AUTOLOAD {
my $self = shift;
Expand Down

0 comments on commit ffdc824

Please sign in to comment.