File Coverage

blib/lib/Couchbase/Couch/ViewRow.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 13 28 46.4


line stmt bran cond sub pod time code
1             package Couchbase::Couch::ViewRow;
2 4     4   16 use strict;
  4         4  
  4         111  
3 4     4   16 use warnings;
  4         4  
  4         114  
4             use Class::XSAccessor {
5 4         37 accessors => [ qw(key value id doc _cbo) ]
6 4     4   16 };
  4         4  
7              
8             sub save {
9 0     0 1   my ($self,%options) = @_;
10 0   0       my $cbo = $self->{_cbo} || delete $options{Client};
11 0 0         if (!$cbo) {
12 0           die("Must have client (Either implicit or explicit)");
13             }
14 0 0         if (!$self->{doc}) {
15 0           die("View result does not include doc");
16             }
17 0           return $cbo->couch_set($self->{id}, $self->doc);
18             }
19              
20             1;
21              
22             __END__