blib/lib/meon/Web/View/JSON.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 6 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 2 | 2 | 100.0 |
pod | n/a | ||
total | 8 | 8 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package meon::Web::View::JSON; | ||||||
2 | |||||||
3 | 2 | 2 | 7692296 | use strict; | |||
2 | 24 | ||||||
2 | 172 | ||||||
4 | 2 | 2 | 11 | use base 'Catalyst::View::JSON'; | |||
2 | 1 | ||||||
2 | 1440 | ||||||
5 | |||||||
6 | use JSON::XS; | ||||||
7 | |||||||
8 | sub encode_json ($) { | ||||||
9 | my($self, $c, $data) = @_; | ||||||
10 | my $encoder = JSON::XS->new->utf8; | ||||||
11 | $encoder->pretty(1) | ||||||
12 | if $c->debug; | ||||||
13 | return $encoder->encode($data); | ||||||
14 | } | ||||||
15 | |||||||
16 | 1; |