line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::TextDomain::OO::Lexicon::StoreJSON; ## no critic (TidyCode)
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
4212
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
5
|
2
|
|
|
2
|
|
1192
|
use JSON::PP ();
|
|
2
|
|
|
|
|
22646
|
|
|
2
|
|
|
|
|
55
|
|
6
|
2
|
|
|
2
|
|
14
|
use Moo;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
7
|
2
|
|
|
2
|
|
618
|
use MooX::StrictConstructor;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
8
|
2
|
|
|
2
|
|
1587
|
use namespace::autoclean;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.026';
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with qw(
|
13
|
|
|
|
|
|
|
Locale::TextDomain::OO::Lexicon::Role::StoreFile
|
14
|
|
|
|
|
|
|
Locale::TextDomain::OO::Lexicon::Role::StoreFilter
|
15
|
|
|
|
|
|
|
);
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_json {
|
18
|
26
|
|
|
26
|
1
|
52
|
my $self = shift;
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return $self->store_content(
|
21
|
|
|
|
|
|
|
JSON::PP ## no critic (LongChainsOfMethodCalls)
|
22
|
|
|
|
|
|
|
->new
|
23
|
|
|
|
|
|
|
->utf8
|
24
|
396
|
|
|
396
|
|
16183
|
->sort_by( sub { $JSON::PP::a cmp $JSON::PP::b } ) ## no critic (PackageVars)
|
25
|
26
|
|
|
|
|
101
|
->encode( $self->data ),
|
26
|
|
|
|
|
|
|
);
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub to_javascript {
|
30
|
2
|
|
|
2
|
1
|
5
|
my $self = shift;
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return
|
33
|
2
|
|
|
|
|
6
|
'var localeTextDomainOOLexicon = '
|
34
|
|
|
|
|
|
|
. $self->to_json
|
35
|
|
|
|
|
|
|
. ";\n";
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub to_html {
|
39
|
1
|
|
|
1
|
1
|
3
|
my $self = shift;
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
return
|
42
|
1
|
|
|
|
|
4
|
qq{\n};
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1;
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__
|