Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add documentation for Mojo::Collection::TO_JSON
  • Loading branch information
wttw committed May 26, 2015
1 parent 5ab59e9 commit 58cabcd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Mojo/Collection.pm
Expand Up @@ -324,6 +324,16 @@ Alias for L<Mojo::Base/"tap">.
Turn collection into array reference.
=head2 TO_JSON
my $array = $collection->TO_JSON;
Turn collection into array reference allowing conversion to JSON by
L<Mojo::JSON>.
# {"baz":["foo","bar"]}
$c->render(json => { baz => Mojo::Collection->new('foo', 'bar') });
=head2 uniq
my $new = $collection->uniq;
Expand Down

0 comments on commit 58cabcd

Please sign in to comment.