line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Autobox::Hash; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
14
|
use Mojo::Base -strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
22
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub json { |
6
|
2
|
|
|
2
|
1
|
2761
|
require Mojo::JSON; |
7
|
2
|
|
|
|
|
40569
|
Mojo::JSON::encode_json(shift); |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
*j = \&json; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Mojo::Autobox::Hash - Autobox hash methods for Mojo::Autobox |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Mojo::Autobox; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# '{"hello": "world"}' |
23
|
|
|
|
|
|
|
{hello => 'world'}->json; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Hash methods for L. These also apply to hash references. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 json |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Serializes the invocant hash using L and returns the result. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 j |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
An alias for L. |
38
|
|
|
|
|
|
|
|