| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mojo::Autobox::Array; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
17
|
use Mojo::Base -strict; |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
25
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub collection { |
|
6
|
2
|
|
|
2
|
1
|
3465
|
require Mojo::Collection; |
|
7
|
2
|
|
|
|
|
42091
|
Mojo::Collection->new(@{shift()}); |
|
|
2
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
|
|
} |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
*c = \&collection; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub json { |
|
13
|
2
|
|
|
2
|
1
|
4062
|
require Mojo::JSON; |
|
14
|
2
|
|
|
|
|
2701
|
Mojo::JSON::encode_json(shift); |
|
15
|
|
|
|
|
|
|
} |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
*j = \&json; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Mojo::Autobox::Array - Autobox array methods for Mojo::Autobox |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use Mojo::Autobox; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# "a" |
|
30
|
|
|
|
|
|
|
[qw/a b c/]->collection->first; |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# '["x", "y", "z"]' |
|
33
|
|
|
|
|
|
|
@array = (qw/x y z/); |
|
34
|
|
|
|
|
|
|
@array->json; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Array methods for L. These methods also apply to array references. |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 collection |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Returns an instance of L, contructed from the elements of the invocant array. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 json |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Serializes the invocant array using L and returns the result. |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 j |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
An alias for L. |
|
53
|
|
|
|
|
|
|
|