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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 223874927cc970ab0f6649817e5e43d2d8e95603df9bb26ac3a7b911ce3b8599
4
- data.tar.gz: 5f9fc630c6bc787ba209be9696a1e0fb961e0a1deaf349d4912e56ea12bc2e65
3
+ metadata.gz: 977daae88c6a50f8ef9c5eeb3252be9670cb44c8eb6bf92fe9dad743e65c919d
4
+ data.tar.gz: 3ae3cc0e01f47d60bbfa5902e51c039af30958890ec2ddc389ac32f4678431af
5
5
  SHA512:
6
- metadata.gz: 88591917460dd9a4ba48115741612b89553b3ec871b1e782aefbe471f7fa210f12c67f027f4d89e7e8dbe93739c4f20c699af635fbb89e7343a023eb3dac4143
7
- data.tar.gz: d09e3a0b83523b5d4210802ecfd4f4001768ee596cbb53e626564d40580834673eb520931a189c3855f2a1e4845f406a483cbbc61d4a5a0b13ed648c955d88fc
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'
@@ -52,7 +52,7 @@ module Mementus
52
52
  @structure.edge(id)
53
53
  end
54
54
 
55
- def nodes(*match)
55
+ def nodes(match=nil)
56
56
  @structure.nodes(match)
57
57
  end
58
58
 
@@ -74,25 +74,19 @@ module Mementus
74
74
  @nodes[id]
75
75
  end
76
76
 
77
- def nodes(*match)
78
- return @nodes.values if match.empty?
77
+ def nodes(match=nil)
78
+ return @nodes.values unless match
79
79
 
80
- criteria = Mementus::Criteria.new(match)
81
-
82
- @nodes.values.select do |node|
83
- selected = false
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
- if criteria.props
90
- key = criteria.props.first.first
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
 
@@ -1,3 +1,3 @@
1
1
  module Mementus
2
- VERSION = '0.8.2'.freeze
2
+ VERSION = '0.8.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mementus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - maetl