mementus 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mementus.rb +0 -1
- data/lib/mementus/graph.rb +1 -1
- data/lib/mementus/structure/incidence_list.rb +10 -16
- data/lib/mementus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 977daae88c6a50f8ef9c5eeb3252be9670cb44c8eb6bf92fe9dad743e65c919d
|
4
|
+
data.tar.gz: 3ae3cc0e01f47d60bbfa5902e51c039af30958890ec2ddc389ac32f4678431af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974136a95ddb6515ad23d95f8315ce95dccf5efc1796603555edaa68edf234ac7ab93bf16605624be729f3cf98f756cc12f5365b04be7974b7dfbaab849926a0
|
7
|
+
data.tar.gz: 923891dbdf9bf495923724f58d96bd5e8d75a13577f4ea78dcebe26fa5b9503e2a80aa674f203e845def7a4c2a524678ad95f9fb87345f1105cad90aeefa05ce
|
data/lib/mementus.rb
CHANGED
@@ -6,7 +6,6 @@ require 'mementus/structure/adjacency_list'
|
|
6
6
|
require 'mementus/structure/incidence_list'
|
7
7
|
require 'mementus/node'
|
8
8
|
require 'mementus/edge'
|
9
|
-
require 'mementus/criteria'
|
10
9
|
require 'mementus/node_proxy'
|
11
10
|
require 'mementus/edge_proxy'
|
12
11
|
require 'mementus/pipeline/pipe'
|
data/lib/mementus/graph.rb
CHANGED
@@ -74,25 +74,19 @@ module Mementus
|
|
74
74
|
@nodes[id]
|
75
75
|
end
|
76
76
|
|
77
|
-
def nodes(
|
78
|
-
return @nodes.values
|
77
|
+
def nodes(match=nil)
|
78
|
+
return @nodes.values unless match
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
if criteria.label
|
86
|
-
selected = node.label == criteria.label
|
80
|
+
if match.is_a?(Hash)
|
81
|
+
@nodes.values.select do |node|
|
82
|
+
key = match.first.first
|
83
|
+
val = match.first.last
|
84
|
+
node[key] == val
|
87
85
|
end
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
val = criteria.props.first.last
|
92
|
-
selected = node[key] == val
|
86
|
+
elsif match.is_a?(Symbol)
|
87
|
+
@nodes.values.select do |node|
|
88
|
+
node.label == match
|
93
89
|
end
|
94
|
-
|
95
|
-
selected
|
96
90
|
end
|
97
91
|
end
|
98
92
|
|
data/lib/mementus/version.rb
CHANGED