File Coverage

blib/lib/Arango/DB/Collection.pm
Criterion Covered Total %
statement 6 13 46.1
branch 0 2 0.0
condition n/a
subroutine 2 5 40.0
pod 2 2 100.0
total 10 22 45.4


line stmt bran cond sub pod time code
1             # ABSTRACT: ArangoDB Collection object
2             package Arango::DB::Collection;
3             $Arango::DB::Collection::VERSION = '0.005';
4 4     4   29 use warnings;
  4         7  
  4         141  
5 4     4   22 use strict;
  4         8  
  4         679  
6              
7             sub _new {
8 0     0     my ($class, %opts) = @_;
9 0           return bless {%opts} => $class;
10             }
11              
12             sub create_document {
13 0     0 1   my ($self, $body) = @_;
14 0 0         die "Arango::DB | Refusing to store undefined body" unless defined($body);
15 0           return $self->{arango}->_api('create_document', { database => $self->{database}, collection => $self->{name}, body => $body})
16             }
17              
18             sub document_paths {
19 0     0 1   my ($self) = @_;
20             return $self->{arango}->_api('all_keys', { database => $self->{database}, collection => $self->{name}, type => "path"})->{result}
21 0           }
22              
23             1;
24              
25             __END__