File Coverage

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


line stmt bran cond sub pod time code
1             # ABSTRACT: ArangoDB Collection object
2             package Arango::DB::Collection;
3             $Arango::DB::Collection::VERSION = '0.004';
4 4     4   28 use warnings;
  4         6  
  4         131  
5 4     4   19 use strict;
  4         8  
  4         862  
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 0       die "Arango::DB | Refusing to store undefined body" unless defined($body) and ref($body) =~ /^(ARRAY|HASH)$/;
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__