Module: Rambling::Trie::Compressible
- Included in:
- Nodes::Node
- Defined in:
- lib/rambling/trie/compressible.rb,
sig/lib/rambling/trie/compressible.rbs
Overview
Provides the compressible behavior for the trie data structure.
Instance Method Summary collapse
- #children_tree ⇒ Hash[Symbol, Nodes::Node[TValue]]
-
#compressible? ⇒ Boolean
Indicates if the current Node can be compressed or not.
- #root? ⇒ Boolean
- #terminal? ⇒ Boolean
Instance Method Details
#children_tree ⇒ Hash[Symbol, Nodes::Node[TValue]]
14 |
# File 'sig/lib/rambling/trie/compressible.rbs', line 14
def children_tree: -> Hash[Symbol, Nodes::Node[TValue]]
|
#compressible? ⇒ Boolean
Indicates if the current Node can be compressed or not.
9 10 11 |
# File 'lib/rambling/trie/compressible.rb', line 9 def compressible? !root? && !terminal? && children_tree.one? end |
#root? ⇒ Boolean
10 |
# File 'sig/lib/rambling/trie/compressible.rbs', line 10
def root?: -> bool
|
#terminal? ⇒ Boolean
12 |
# File 'sig/lib/rambling/trie/compressible.rbs', line 12
def terminal?: -> bool
|