isomorfeus-data 1.0.0.zeta25 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +47 -21
- data/README.md +38 -46
- data/lib/isomorfeus/data/attribute_support.rb +176 -176
- data/lib/isomorfeus/data/config.rb +79 -110
- data/lib/isomorfeus/data/element_validator.rb +147 -147
- data/lib/isomorfeus/data/ferret_accelerator.rb +66 -0
- data/lib/isomorfeus/data/field_support.rb +110 -0
- data/lib/isomorfeus/data/generic_class_api.rb +136 -116
- data/lib/isomorfeus/data/generic_instance_api.rb +150 -145
- data/lib/isomorfeus/data/hamster_accelerator.rb +87 -0
- data/lib/isomorfeus/data/hamster_storage_expander.rb +94 -0
- data/lib/isomorfeus/data/handler/generic.rb +134 -138
- data/lib/isomorfeus/data/reducer.rb +30 -30
- data/lib/isomorfeus/data/version.rb +4 -4
- data/lib/isomorfeus-data.rb +56 -64
- data/lib/isomorfeus_data/lucid_document/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_document/mixin.rb +148 -0
- data/lib/isomorfeus_data/lucid_file/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_file/mixin.rb +217 -0
- data/lib/isomorfeus_data/lucid_object/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_object/mixin.rb +216 -0
- data/lib/isomorfeus_data/lucid_query/base.rb +10 -0
- data/lib/isomorfeus_data/lucid_query/mixin.rb +81 -0
- data/lib/isomorfeus_data/lucid_query_result.rb +97 -0
- data/opal/uri/common.rb +18 -0
- data/opal/uri/generic.rb +47 -0
- data/opal/uri.rb +29 -0
- metadata +85 -96
- data/lib/isomorfeus/data/handler/arango.rb +0 -56
- data/lib/isomorfeus/data/handler/object_call.rb +0 -40
- data/lib/isomorfeus/data/handler/object_store.rb +0 -40
- data/lib/isomorfeus_data/lucid_data/array/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/array/mixin.rb +0 -580
- data/lib/isomorfeus_data/lucid_data/collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/collection/finders.rb +0 -83
- data/lib/isomorfeus_data/lucid_data/collection/mixin.rb +0 -737
- data/lib/isomorfeus_data/lucid_data/composition/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/composition/mixin.rb +0 -234
- data/lib/isomorfeus_data/lucid_data/document/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/document/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/edge/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/edge/mixin.rb +0 -286
- data/lib/isomorfeus_data/lucid_data/edge_collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/edge_collection/finders.rb +0 -134
- data/lib/isomorfeus_data/lucid_data/edge_collection/mixin.rb +0 -747
- data/lib/isomorfeus_data/lucid_data/generic_collection.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_edge.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_edge_collection.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/generic_node.rb +0 -4
- data/lib/isomorfeus_data/lucid_data/graph/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/graph/finders.rb +0 -141
- data/lib/isomorfeus_data/lucid_data/graph/mixin.rb +0 -489
- data/lib/isomorfeus_data/lucid_data/hash/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/hash/mixin.rb +0 -427
- data/lib/isomorfeus_data/lucid_data/link/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/link/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/link_collection/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/link_collection/mixin.rb +0 -9
- data/lib/isomorfeus_data/lucid_data/node/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/node/mixin.rb +0 -232
- data/lib/isomorfeus_data/lucid_data/query/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/query/mixin.rb +0 -83
- data/lib/isomorfeus_data/lucid_data/query_result.rb +0 -95
- data/lib/isomorfeus_data/lucid_data/vertex/base.rb +0 -13
- data/lib/isomorfeus_data/lucid_data/vertex/mixin.rb +0 -9
- data/lib/lucid_arango/collection/base.rb +0 -13
- data/lib/lucid_arango/collection/mixin.rb +0 -18
- data/lib/lucid_arango/document/base.rb +0 -13
- data/lib/lucid_arango/document/mixin.rb +0 -9
- data/lib/lucid_arango/edge/base.rb +0 -13
- data/lib/lucid_arango/edge/mixin.rb +0 -18
- data/lib/lucid_arango/edge_collection/base.rb +0 -13
- data/lib/lucid_arango/edge_collection/mixin.rb +0 -18
- data/lib/lucid_arango/graph/base.rb +0 -13
- data/lib/lucid_arango/graph/mixin.rb +0 -18
- data/lib/lucid_arango/node/base.rb +0 -13
- data/lib/lucid_arango/node/mixin.rb +0 -79
- data/lib/lucid_arango/object/base.rb +0 -11
- data/lib/lucid_arango/object/mixin.rb +0 -158
- data/lib/lucid_arango/remote_object/base.rb +0 -11
- data/lib/lucid_arango/remote_object/mixin.rb +0 -17
- data/lib/lucid_arango/vertex/base.rb +0 -13
- data/lib/lucid_arango/vertex/mixin.rb +0 -9
@@ -1,134 +0,0 @@
|
|
1
|
-
module LucidData
|
2
|
-
module EdgeCollection
|
3
|
-
module Finders
|
4
|
-
def find(attribute_hash = nil, &block)
|
5
|
-
if block_given?
|
6
|
-
edges.each do |edge|
|
7
|
-
return edge if block.call(edge)
|
8
|
-
end
|
9
|
-
else
|
10
|
-
edge_class = attribute_hash.delete(:class)
|
11
|
-
is_a_module = attribute_hash.delete(:is_a)
|
12
|
-
edges.each do |edge|
|
13
|
-
if edge_class
|
14
|
-
next unless edge.class == edge_class
|
15
|
-
end
|
16
|
-
if is_a_module
|
17
|
-
next unless edge.is_a?(is_a_module)
|
18
|
-
end
|
19
|
-
found = true
|
20
|
-
attribute_hash.each do |k,v|
|
21
|
-
found &&= (edge[k] == v)
|
22
|
-
break unless found
|
23
|
-
end
|
24
|
-
return edge if found
|
25
|
-
end
|
26
|
-
end
|
27
|
-
nil
|
28
|
-
end
|
29
|
-
|
30
|
-
def find_all(attribute_hash = nil, &block)
|
31
|
-
found_edges = Set.new
|
32
|
-
if block_given?
|
33
|
-
edges.each do |edge|
|
34
|
-
found_edges << edge if block.call(edge)
|
35
|
-
end
|
36
|
-
else
|
37
|
-
edge_class = attribute_hash.delete(:class)
|
38
|
-
is_a_module = attribute_hash.delete(:is_a)
|
39
|
-
edges.each do |edge|
|
40
|
-
if edge_class
|
41
|
-
next unless edge.class == edge_class
|
42
|
-
end
|
43
|
-
if is_a_module
|
44
|
-
next unless edge.is_a?(is_a_module)
|
45
|
-
end
|
46
|
-
found = true
|
47
|
-
attribute_hash.each do |k,v|
|
48
|
-
found &&= (edge[k] == v)
|
49
|
-
break unless found
|
50
|
-
end
|
51
|
-
found_edges << edge if found
|
52
|
-
end
|
53
|
-
end
|
54
|
-
found_edges
|
55
|
-
end
|
56
|
-
|
57
|
-
def find_by_key(edge_key)
|
58
|
-
edges.each do |edge|
|
59
|
-
return edge if edge.key == edge_key
|
60
|
-
end
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
|
64
|
-
if RUBY_ENGINE == 'opal'
|
65
|
-
def find_by_sid(edge)
|
66
|
-
edge_sid = edge.respond_to?(:to_sid) ? edge.to_sid : edge
|
67
|
-
edges_as_sids.each do |sid|
|
68
|
-
return Isomorfeus.instance_from_sid(edge_sid) if sid == edge_sid
|
69
|
-
end
|
70
|
-
nil
|
71
|
-
end
|
72
|
-
else
|
73
|
-
def find_by_sid(edge)
|
74
|
-
edge_sid = edge.respond_to?(:to_sid) ? edge.to_sid : edge
|
75
|
-
edges.each do |edge|
|
76
|
-
return edge if edge.to_sid == edge_sid
|
77
|
-
end
|
78
|
-
nil
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def find_by_from(node)
|
83
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
84
|
-
edges.each do |edge|
|
85
|
-
return edge if edge.from_as_sid == node_sid
|
86
|
-
end
|
87
|
-
nil
|
88
|
-
end
|
89
|
-
|
90
|
-
def find_all_by_from(node)
|
91
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
92
|
-
found_edges = []
|
93
|
-
edges.each do |edge|
|
94
|
-
found_edges << edge if edge.from_as_sid == node_sid
|
95
|
-
end
|
96
|
-
found_edges
|
97
|
-
end
|
98
|
-
|
99
|
-
def find_by_to(node)
|
100
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
101
|
-
edges.each do |edge|
|
102
|
-
return edge if edge.to_as_sid == node_sid
|
103
|
-
end
|
104
|
-
nil
|
105
|
-
end
|
106
|
-
|
107
|
-
def find_all_by_to(node)
|
108
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
109
|
-
found_edges = []
|
110
|
-
edges.each do |edge|
|
111
|
-
found_edges << edge if edge.to_as_sid == node_sid
|
112
|
-
end
|
113
|
-
found_edges
|
114
|
-
end
|
115
|
-
|
116
|
-
def find_by_target(node)
|
117
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
118
|
-
edges.each do |edge|
|
119
|
-
return edge if edge.from_as_sid == node_sid || edge.to_as_sid == node_sid
|
120
|
-
end
|
121
|
-
nil
|
122
|
-
end
|
123
|
-
|
124
|
-
def find_all_by_target(node)
|
125
|
-
node_sid = node.respond_to?(:to_sid) ? node.to_sid : node
|
126
|
-
found_edges = []
|
127
|
-
edges.each do |edge|
|
128
|
-
found_edges << edge if edge.from_as_sid == node_sid || edge.to_as_sid == node_sid
|
129
|
-
end
|
130
|
-
found_edges
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|