Class: Rambling::Trie::Nodes::Compressed
- Defined in:
- lib/rambling/trie/nodes/compressed.rb
Overview
A representation of a node in an compressed trie data structure.
Instance Attribute Summary
Attributes inherited from Node
#children_tree, #letter, #parent
Instance Method Summary collapse
-
#add(_) ⇒ nil
Always raises InvalidOperation when trying to add a word to the current compressed trie node.
-
#compressed? ⇒ Boolean
Always return ‘true` for a compressed node.
Methods inherited from Node
#[], #[]=, #children, #delete, #first_child, #initialize, #key?, #match_prefix, #partial_word?, #root?, #scan, #terminal!, #terminal?, #word?
Methods included from Inspectable
Methods included from Stringifyable
Methods included from Comparable
Methods included from Enumerable
Methods included from Compressible
Constructor Details
This class inherits a constructor from Rambling::Trie::Nodes::Node
Instance Method Details
#add(_) ⇒ nil
Always raises InvalidOperation when trying to add a word to the current compressed trie node
13 14 15 16 |
# File 'lib/rambling/trie/nodes/compressed.rb', line 13 def add _ raise Rambling::Trie::InvalidOperation, 'Cannot add word to compressed trie' end |
#compressed? ⇒ Boolean
Always return ‘true` for a compressed node.
20 21 22 |
# File 'lib/rambling/trie/nodes/compressed.rb', line 20 def compressed? true end |