modular_tree 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/modular_tree/pool.rb +4 -2
- data/lib/modular_tree/version.rb +1 -1
- data/lib/modular_tree.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08649719e3acd43aaaba027428bce680e0e376a5d11192357b5fb8078795a704'
|
4
|
+
data.tar.gz: '08cb0635c2ec27a4f29390bdecddbe1484f5d48dc1f180faf6b07d7122802ac1'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2766c613470299bebff94a45aad0b386221e7a1eb159833f5d13f7c4015949687cede5cc71ed08b190f3fc7b0d24677e3e01d8ebc78f950c8fed4fadc1b7500
|
7
|
+
data.tar.gz: fec9a23e683d539ba8a92510aaf4c0f0ae3c1fb64cfcac05a91f254ae49c937969a5eb83e042f5f5b4faf592b9781b24b83bffd4991ded8653f7fc8d47e34a53
|
data/lib/modular_tree/pool.rb
CHANGED
@@ -3,6 +3,7 @@ module Tree
|
|
3
3
|
#
|
4
4
|
# Pool adds a @pool class variable to the including class and all of its
|
5
5
|
# subclasses
|
6
|
+
#
|
6
7
|
module Pool
|
7
8
|
include PathAlgorithms
|
8
9
|
|
@@ -14,12 +15,13 @@ module Tree
|
|
14
15
|
|
15
16
|
def initialize(*args)
|
16
17
|
super
|
18
|
+
!self.class.uid?(self.uid) or raise TreeError, "Duplicate UID: #{self.uid}"
|
17
19
|
self.class.send(:[]=, self.uid, self)
|
18
20
|
end
|
19
21
|
|
20
22
|
module ClassMethods
|
21
|
-
def
|
22
|
-
def
|
23
|
+
def uid?(uid) = @pool.key?(uid)
|
24
|
+
def uids = @pool.keys
|
23
25
|
def nodes = @pool.values
|
24
26
|
def size = @pool.size
|
25
27
|
def empty? = @pool.empty?
|
data/lib/modular_tree/version.rb
CHANGED
data/lib/modular_tree.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modular_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: constrain
|