File Coverage

blib/lib/Data/Context/Loader/File/JSON.pm
Criterion Covered Total %
statement 21 23 91.3
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 29 32 90.6


line stmt bran cond sub pod time code
1             package Data::Context::Loader::File::JSON;
2              
3             # Created on: 2013-10-29 17:34:35
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 1     1   1050 use Moose;
  1         2  
  1         8  
10 1     1   5207 use version;
  1         2  
  1         8  
11 1     1   62 use Carp;
  1         2  
  1         79  
12 1     1   5 use Scalar::Util;
  1         2  
  1         31  
13 1     1   4 use List::Util;
  1         2  
  1         57  
14             #use List::MoreUtils;
15 1     1   3 use Data::Dumper qw/Dumper/;
  1         2  
  1         41  
16 1     1   4 use English qw/ -no_match_vars /;
  1         1  
  1         9  
17              
18              
19             our $VERSION = version->new('0.1.10');
20              
21             extends 'Data::Context::Loader::File';
22              
23             has '+module' => (
24             default => 'JSON',
25             );
26              
27             sub loader {
28 0     0 1   my ($self, $file) = @_;
29 0           return JSON->new->utf8->shrink->decode($file);
30             }
31              
32             1;
33              
34             __END__
35              
36             =head1 NAME
37              
38             Data::Context::Loader::File::JSON - <One-line description of module's purpose>
39              
40             =head1 VERSION
41              
42             This documentation refers to Data::Context::Loader::File::JSON version 0.1.10
43              
44             =head1 SYNOPSIS
45              
46             use Data::Context::Loader::File::JSON;
47              
48             # Brief but working code example(s) here showing the most common usage(s)
49             # This section will be as far as many users bother reading, so make it as
50             # educational and exemplary as possible.
51              
52             =head1 DESCRIPTION
53              
54             =head1 SUBROUTINES/METHODS
55              
56             =head2 C<loader ($file)>
57              
58             Loads the file as plain JSON
59              
60             =head1 DIAGNOSTICS
61              
62             =head1 CONFIGURATION AND ENVIRONMENT
63              
64             =head1 DEPENDENCIES
65              
66             =head1 INCOMPATIBILITIES
67              
68             =head1 BUGS AND LIMITATIONS
69              
70             There are no known bugs in this module.
71              
72             Please report problems to Ivan Wills (ivan.wills@gmail.com).
73              
74             Patches are welcome.
75              
76             =head1 AUTHOR
77              
78             Ivan Wills - (ivan.wills@gmail.com)
79              
80             =head1 LICENSE AND COPYRIGHT
81              
82             Copyright (c) 2013 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
83             All rights reserved.
84              
85             This module is free software; you can redistribute it and/or modify it under
86             the same terms as Perl itself. See L<perlartistic>. This program is
87             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
88             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
89             PARTICULAR PURPOSE.
90              
91             =cut