File Coverage

blib/lib/IRC/Indexer/Output/JSON.pm
Criterion Covered Total %
statement 12 15 80.0
branch n/a
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 18 22 81.8


line stmt bran cond sub pod time code
1             package IRC::Indexer::Output::JSON;
2              
3 2     2   25601 use strict;
  2         5  
  2         75  
4 2     2   11 use warnings;
  2         5  
  2         55  
5 2     2   8509 use JSON::XS;
  2         34896  
  2         543  
6              
7             require IRC::Indexer::Output;
8             our @ISA = qw/IRC::Indexer::Output/;
9              
10             sub dump {
11 2     2 1 951 my ($self) = @_;
12 2         74 $self->{Output} = JSON::XS->new->utf8(1)->indent->encode(
13             $self->{Input}
14             );
15 2         30 $self->SUPER::dump();
16             }
17              
18             sub write {
19 0     0 1   my ($self, $path) = @_;
20            
21 0           $self->{Output} = JSON::XS->new->utf8(1)->indent->encode(
22             $self->{Input}
23             ) . "\n" ;
24              
25 0           $self->SUPER::write($path);
26             }
27              
28             1;
29             __END__