File Coverage

blib/lib/WebAPI/DBIC/Util.pm
Criterion Covered Total %
statement 16 18 88.8
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 22 24 91.6


line stmt bran cond sub pod time code
1             package WebAPI::DBIC::Util;
2             $WebAPI::DBIC::Util::VERSION = '0.004001';
3             # based on webmachine-perl/lib/Web/Machine/Util.pm
4             #
5             # ABSTRACT: General Utility module
6              
7 4     4   6797471 use strict;
  4         18  
  4         220  
8 4     4   20 use warnings;
  4         5  
  4         223  
9              
10 4     4   26 use Carp qw[ confess ];
  4         94  
  4         420  
11 4     4   20 use Scalar::Util qw[ blessed ];
  4         4  
  4         612  
12 4     4   21 use List::Util qw[ first ];
  4         5  
  4         597  
13              
14 4     4   963 use HTTP::Headers::ActionPack;
  0            
  0            
15              
16             use Sub::Exporter -setup => {
17             exports => [qw[
18             first
19             pair_key
20             pair_value
21             bind_path
22             create_date
23             create_header
24             inflate_headers
25             ]]
26             };
27              
28             sub pair_key { return ( keys %{ $_[0] } )[0] }
29             sub pair_value { return ( values %{ $_[0] } )[0] }
30              
31             {
32             my $ACTION_PACK = HTTP::Headers::ActionPack->new;
33             sub create_header { return $ACTION_PACK->create( @_ ) }
34             sub create_date { return $ACTION_PACK->create( 'DateHeader' => shift ) }
35             sub inflate_headers { return $ACTION_PACK->inflate( @_ ) }
36             sub get_action_pack { return $ACTION_PACK }
37             }
38              
39             1;
40              
41             __END__
42              
43             =pod
44              
45             =encoding UTF-8
46              
47             =head1 NAME
48              
49             WebAPI::DBIC::Util - General Utility module
50              
51             =head1 VERSION
52              
53             version 0.004001
54              
55             =head1 SYNOPSIS
56              
57             use WebAPI::DBIC::Util;
58              
59             =head1 DESCRIPTION
60              
61             This is just a basic utility module used internally by L<WebAPI::DBIC>.
62             There is no real user servicable parts in here.
63              
64             =head1 AUTHOR
65              
66             Tim Bunce <Tim.Bunce@pobox.com>
67              
68             =head1 COPYRIGHT AND LICENSE
69              
70             This software is copyright (c) 2015 by Tim Bunce.
71              
72             This is free software; you can redistribute it and/or modify it under
73             the same terms as the Perl 5 programming language system itself.
74              
75             =cut