File Coverage

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


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 3     3   1411 use Moose;
  3         6  
  3         29  
10 3     3   24204 use version;
  3         8  
  3         26  
11 3     3   343 use Carp;
  3         7  
  3         245  
12 3     3   23 use Scalar::Util;
  3         4  
  3         133  
13 3     3   29 use List::Util;
  3         6  
  3         205  
14             #use List::MoreUtils;
15 3     3   19 use Data::Dumper qw/Dumper/;
  3         7  
  3         234  
16 3     3   20 use English qw/ -no_match_vars /;
  3         7  
  3         27  
17              
18              
19             our $VERSION = version->new('0.1.8');
20              
21             extends 'Data::Context::Loader::File';
22              
23             has '+module' => (
24             default => 'JSON',
25             );
26              
27             sub loader {
28 4     4 1 1393 my ($self, $file) = @_;
29 4         109 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.8
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