File Coverage

blib/lib/Protocol/Database/PostgreSQL/Backend/CopyInResponse.pm
Criterion Covered Total %
statement 9 18 50.0
branch n/a
condition n/a
subroutine 3 5 60.0
pod 1 2 50.0
total 13 25 52.0


line stmt bran cond sub pod time code
1             package Protocol::Database::PostgreSQL::Backend::CopyInResponse;
2              
3 1     1   6 use strict;
  1         2  
  1         25  
4 1     1   4 use warnings;
  1         2  
  1         35  
5              
6             our $VERSION = '1.004'; # VERSION
7              
8 1     1   4 use parent qw(Protocol::Database::PostgreSQL::Backend);
  1         2  
  1         8  
9              
10             =head1 NAME
11              
12             Protocol::Database::PostgreSQL::Backend::CopyInResponse
13              
14             =head1 DESCRIPTION
15              
16             =cut
17              
18 0     0 0   sub type { 'copy_in_response' }
19              
20             sub new_from_message {
21 0     0 1   my ($class, $msg) = @_;
22 0           (undef, undef, my $type, my $count) = unpack('C1N1C1n1', $msg);
23 0           substr $msg, 0, 8, '';
24 0           my @formats;
25 0           for (1..$count) {
26 0           push @formats, unpack('n1', $msg);
27 0           substr $msg, 0, 2, '';
28             }
29 0           return $class->new(
30             formats => \@formats
31             );
32             }
33              
34             1;
35              
36             =head1 AUTHOR
37              
38             Tom Molesworth
39              
40             =head1 LICENSE
41              
42             Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself.
43