| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package ArangoDB2::Traversal; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 20 |  |  | 20 |  | 82 | use strict; | 
|  | 20 |  |  |  |  | 23 |  | 
|  | 20 |  |  |  |  | 604 |  | 
| 4 | 20 |  |  | 20 |  | 72 | use warnings; | 
|  | 20 |  |  |  |  | 19 |  | 
|  | 20 |  |  |  |  | 595 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 20 |  |  |  |  | 1306 | use base qw( | 
| 7 |  |  |  |  |  |  | ArangoDB2::Base | 
| 8 | 20 |  |  | 20 |  | 76 | ); | 
|  | 20 |  |  |  |  | 24 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 20 |  |  | 20 |  | 84 | use Data::Dumper; | 
|  | 20 |  |  |  |  | 22 |  | 
|  | 20 |  |  |  |  | 765 |  | 
| 11 | 20 |  |  | 20 |  | 74 | use JSON::XS; | 
|  | 20 |  |  |  |  | 18 |  | 
|  | 20 |  |  |  |  | 8037 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | my $JSON = JSON::XS->new->utf8; | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | my @PARAMS = qw( | 
| 16 |  |  |  |  |  |  | direction edgeCollection expander filter graphName init itemOrder maxDepth | 
| 17 |  |  |  |  |  |  | maxIterations minDepth order sort startVertex strategy uniqueness visitor | 
| 18 |  |  |  |  |  |  | ); | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | # direction | 
| 21 |  |  |  |  |  |  | # | 
| 22 |  |  |  |  |  |  | # get/ set direction | 
| 23 | 0 |  |  | 0 | 1 |  | sub direction { shift->_get_set('direction', @_) } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | # edgeCollection | 
| 26 |  |  |  |  |  |  | # | 
| 27 |  |  |  |  |  |  | # get/ set edgeCollection | 
| 28 | 0 |  |  | 0 | 1 |  | sub edgeCollection { shift->_get_set('edgeCollection', @_) } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | # execute | 
| 31 |  |  |  |  |  |  | # | 
| 32 |  |  |  |  |  |  | # POST /_api/traversal | 
| 33 |  |  |  |  |  |  | sub execute | 
| 34 |  |  |  |  |  |  | { | 
| 35 | 0 |  |  | 0 | 1 |  | my($self, $args) = @_; | 
| 36 |  |  |  |  |  |  | # process request args | 
| 37 | 0 |  |  |  |  |  | $args = $self->_build_args($args, \@PARAMS); | 
| 38 |  |  |  |  |  |  | # if neither edgeCollection or graphName is set then | 
| 39 |  |  |  |  |  |  | # use the current graph name | 
| 40 | 0 | 0 | 0 |  |  |  | $args->{graphName} = $self->graph->name | 
| 41 |  |  |  |  |  |  | unless defined $args->{graphName} | 
| 42 |  |  |  |  |  |  | or defined $args->{edgeCollection}; | 
| 43 |  |  |  |  |  |  | # make request | 
| 44 | 0 |  |  |  |  |  | return $self->arango->http->post( | 
| 45 |  |  |  |  |  |  | $self->api_path('traversal'), | 
| 46 |  |  |  |  |  |  | undef, | 
| 47 |  |  |  |  |  |  | $JSON->encode($args), | 
| 48 |  |  |  |  |  |  | ); | 
| 49 |  |  |  |  |  |  | } | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | # expander | 
| 52 |  |  |  |  |  |  | # | 
| 53 |  |  |  |  |  |  | # get/ set expander | 
| 54 | 0 |  |  | 0 | 1 |  | sub expander { shift->_get_set('expander', @_) } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | # filter | 
| 57 |  |  |  |  |  |  | # | 
| 58 |  |  |  |  |  |  | # get/ set filter | 
| 59 | 0 |  |  | 0 | 1 |  | sub filter { shift->_get_set('filter', @_) } | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | # graphName | 
| 62 |  |  |  |  |  |  | # | 
| 63 |  |  |  |  |  |  | # get/ set graphName | 
| 64 | 0 |  |  | 0 | 1 |  | sub graphName { shift->_get_set('graphName', @_) } | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | # init | 
| 67 |  |  |  |  |  |  | # | 
| 68 |  |  |  |  |  |  | # get/ set init | 
| 69 | 0 |  |  | 0 | 1 |  | sub init { shift->_get_set('init', @_) } | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | # itemOrder | 
| 72 |  |  |  |  |  |  | # | 
| 73 |  |  |  |  |  |  | # get/ set itemOrder | 
| 74 | 0 |  |  | 0 | 1 |  | sub itemOrder { shift->_get_set('itemOrder', @_) } | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | # maxDepth | 
| 77 |  |  |  |  |  |  | # | 
| 78 |  |  |  |  |  |  | # get/ set maxDepth | 
| 79 | 0 |  |  | 0 | 1 |  | sub maxDepth { shift->_get_set('maxDepth', @_) } | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | # maxIterations | 
| 82 |  |  |  |  |  |  | # | 
| 83 |  |  |  |  |  |  | # get/ set maxIterations | 
| 84 | 0 |  |  | 0 | 1 |  | sub maxIterations { shift->_get_set('maxIterations', @_) } | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | # minDepth | 
| 87 |  |  |  |  |  |  | # | 
| 88 |  |  |  |  |  |  | # get/ set minDepth | 
| 89 | 0 |  |  | 0 | 1 |  | sub minDepth { shift->_get_set('minDepth', @_) } | 
| 90 |  |  |  |  |  |  |  | 
| 91 |  |  |  |  |  |  | # order | 
| 92 |  |  |  |  |  |  | # | 
| 93 |  |  |  |  |  |  | # get/ set order | 
| 94 | 0 |  |  | 0 | 1 |  | sub order { shift->_get_set('order', @_) } | 
| 95 |  |  |  |  |  |  |  | 
| 96 |  |  |  |  |  |  | # sort | 
| 97 |  |  |  |  |  |  | # | 
| 98 |  |  |  |  |  |  | # get/ set sort | 
| 99 | 0 |  |  | 0 | 1 |  | sub sort { shift->_get_set('sort', @_) } | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | # startVertex | 
| 102 |  |  |  |  |  |  | # | 
| 103 |  |  |  |  |  |  | # get/ set startVertex | 
| 104 | 0 |  |  | 0 | 1 |  | sub startVertex { shift->_get_set_id('startVertex', @_) } | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | # strategy | 
| 107 |  |  |  |  |  |  | # | 
| 108 |  |  |  |  |  |  | # get/ set strategy | 
| 109 | 0 |  |  | 0 | 1 |  | sub strategy { shift->_get_set('strategy', @_) } | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | # uniqueness | 
| 112 |  |  |  |  |  |  | # | 
| 113 |  |  |  |  |  |  | # get/ set uniqueness | 
| 114 | 0 |  |  | 0 | 1 |  | sub uniqueness { shift->_get_set('uniqueness', @_) } | 
| 115 |  |  |  |  |  |  |  | 
| 116 |  |  |  |  |  |  | # visitor | 
| 117 |  |  |  |  |  |  | # | 
| 118 |  |  |  |  |  |  | # get/ set visitor | 
| 119 | 0 |  |  | 0 | 1 |  | sub visitor { shift->_get_set('visitor', @_) } | 
| 120 |  |  |  |  |  |  |  | 
| 121 |  |  |  |  |  |  | 1; | 
| 122 |  |  |  |  |  |  |  | 
| 123 |  |  |  |  |  |  | __END__ |