line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ArangoDB2::Graph::Edge; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
73
|
use strict; |
|
21
|
|
|
|
|
26
|
|
|
21
|
|
|
|
|
622
|
|
4
|
21
|
|
|
21
|
|
79
|
use warnings; |
|
21
|
|
|
|
|
22
|
|
|
21
|
|
|
|
|
477
|
|
5
|
|
|
|
|
|
|
|
6
|
21
|
|
|
|
|
7936
|
use base qw( |
7
|
|
|
|
|
|
|
ArangoDB2::Graph::Vertex |
8
|
21
|
|
|
21
|
|
74
|
); |
|
21
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
21
|
|
|
21
|
|
101
|
use Data::Dumper; |
|
21
|
|
|
|
|
23
|
|
|
21
|
|
|
|
|
772
|
|
11
|
21
|
|
|
21
|
|
73
|
use JSON::XS; |
|
21
|
|
|
|
|
25
|
|
|
21
|
|
|
|
|
3432
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $JSON = JSON::XS->new->utf8; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# POST /_api/gharial/graph-name/edge/collection-name |
17
|
|
|
|
|
|
|
sub create |
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
0
|
1
|
|
my($self, $data, $args) = @_; |
20
|
|
|
|
|
|
|
# require data |
21
|
0
|
0
|
|
|
|
|
die "Invlalid args" |
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
|
|
|
0
|
1
|
|
sub from { shift->_get_set_id('from', @_) } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# to |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
# get/set to |
40
|
0
|
|
|
0
|
1
|
|
sub to { shift->_get_set_id('to', @_) } |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# _class |
43
|
|
|
|
|
|
|
# |
44
|
|
|
|
|
|
|
# internal name for class |
45
|
0
|
|
|
0
|
|
|
sub _class { 'edge' } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# _register |
48
|
|
|
|
|
|
|
# |
49
|
|
|
|
|
|
|
# internal name for object index |
50
|
0
|
|
|
0
|
|
|
sub _register { 'edges' } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |