modular_tree 0.1.0 → 0.2.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/algorithms.rb +3 -2
- data/lib/modular_tree/implementations.rb +4 -1
- data/lib/modular_tree/properties.rb +1 -0
- data/lib/modular_tree/version.rb +1 -1
- 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: 420d72c774f0602ebf2b50b7346ee64759aaf48f89b8e041c80fe76464dbd379
|
4
|
+
data.tar.gz: 4ceb72733d99138a6244c4b163b46d0fb10fcdf20b8f7d61e582903bab750bc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5b2b90bcaaa71fd2754093cbd3ccca1fea3c9193c3261a82911bd10c7c8c6e74476804006238215aaf448062424dbfeef606550b69f378fd742d159d58b05b2
|
7
|
+
data.tar.gz: 8330f74bf4368cc7d56f35b42e48ff4f1dd51641ed94f05f4340f222eef22d62d0a3b32c883e2e6d916b78762a3d23870e62131b3e2f461c10ccabf16070d6ce
|
@@ -49,8 +49,9 @@ module Tree
|
|
49
49
|
include NodeProperty
|
50
50
|
include BranchesProperty
|
51
51
|
|
52
|
-
# True if the node doesn't contain any branches (#empty? for trees)
|
53
|
-
|
52
|
+
# True if the node doesn't contain any branches (#empty? for trees).
|
53
|
+
# Default implementation in BranchesProperty
|
54
|
+
# def bare? = raise NotImplemented
|
54
55
|
|
55
56
|
# The number of nodes in the tree. Note that this can be an expensive
|
56
57
|
# operation because every node has to be visited
|
@@ -168,7 +168,10 @@ module Tree
|
|
168
168
|
def each_child(&block) = @children.map(&block)
|
169
169
|
def attach(child) = @children << child
|
170
170
|
|
171
|
-
# Can be used with any array implementation
|
171
|
+
# Can be used with any array implementation. +where+ is either an Integer
|
172
|
+
# index or an object
|
173
|
+
#
|
174
|
+
# TODO: Rename #attach. #insert & #append are Enumerable operations
|
172
175
|
def insert(where, child) = insert_append(:insert, where, child)
|
173
176
|
def append(where, child) = insert_append(:append, where, child)
|
174
177
|
|
data/lib/modular_tree/version.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.2.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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: constrain
|