| 1 | package ArangoDB2::Graph::Edge; | ||||||||||
| 2 | |||||||||||
| 3 | 22 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 22 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 22 | ▶ | use base qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | ArangoDB2::Graph::Vertex | ||||||||||
| 8 | 22 | ); | |||||||||
| 9 | |||||||||||
| 10 | 22 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 22 | ▶ | use JSON::XS; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 22 | my $JSON = JSON::XS->new->utf8; | |||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | # POST /_api/gharial/graph-name/edge/collection-name | ||||||||||
| 17 | sub create | ||||||||||
| 18 | 0 | ▶ | { | ||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 19 | 0 | my($self, $data, $args) = @_; | |||||||||
| 20 | # require data | ||||||||||
| 21 | 0 | ▶ | die "Invlalid args" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | unless ref $data eq 'HASH'; | ||||||||||
| 23 | # process args | ||||||||||
| 24 | 0 | $args = $self->_build_args($args, ['from', 'to']); | |||||||||
| 25 | # from and to go in data | ||||||||||
| 26 | 0 | $data->{_from} = delete $args->{from}; | |||||||||
| 27 | 0 | $data->{_to} = delete $args->{to}; | |||||||||
| 28 | |||||||||||
| 29 | 0 | return $self->SUPER::create($data, $args); | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | # from | ||||||||||
| 33 | # | ||||||||||
| 34 | # get/set from | ||||||||||
| 35 | 0 | ▶ | sub from { shift->_get_set_id('from', @_) } | ||||||||
|
Subroutine
from: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 36 | |||||||||||
| 37 | # to | ||||||||||
| 38 | # | ||||||||||
| 39 | # get/set to | ||||||||||
| 40 | 0 | ▶ | sub to { shift->_get_set_id('to', @_) } | ||||||||
|
Subroutine
to: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | |||||||||||
| 42 | # _class | ||||||||||
| 43 | # | ||||||||||
| 44 | # internal name for class | ||||||||||
| 45 | 0 | ▶ | sub _class { 'edge' } | ||||||||
|
Subroutine
_class: not called CC=1 SCAR=6.9
| |||||||||||
| 46 | |||||||||||
| 47 | # _register | ||||||||||
| 48 | # | ||||||||||
| 49 | # internal name for object index | ||||||||||
| 50 | 0 | ▶ | sub _register { 'edges' } | ||||||||
|
Subroutine
_register: not called CC=1 SCAR=6.9
| |||||||||||
| 51 | |||||||||||
| 52 | |||||||||||
| 53 | 22 | 1; | |||||||||
| 54 | |||||||||||
| 55 | __END__ | ||||||||||