Module: Rambling::Trie::Comparable
- Included in:
- Nodes::Node
- Defined in:
- lib/rambling/trie/comparable.rb,
sig/lib/rambling/trie/comparable.rbs
Overview
Provides the comparable behavior for the trie data structure.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compares two nodes.
- #children_tree ⇒ Hash[Symbol, Nodes::Node[TValue]]
- #letter ⇒ Symbol?
- #terminal? ⇒ Boolean
- #value ⇒ TValue?
Instance Method Details
#==(other) ⇒ Boolean
Compares two nodes.
12 13 14 15 16 17 |
# File 'lib/rambling/trie/comparable.rb', line 12 def == other letter == other.letter && terminal? == other.terminal? && value == other.value && children_tree == other.children_tree end |
#children_tree ⇒ Hash[Symbol, Nodes::Node[TValue]]
16 |
# File 'sig/lib/rambling/trie/comparable.rbs', line 16 def children_tree: -> Hash[Symbol, Nodes::Node[TValue]] |
#letter ⇒ Symbol?
10 |
# File 'sig/lib/rambling/trie/comparable.rbs', line 10 def letter: -> Symbol? |
#terminal? ⇒ Boolean
14 |
# File 'sig/lib/rambling/trie/comparable.rbs', line 14 def terminal?: -> bool |
#value ⇒ TValue?
12 |
# File 'sig/lib/rambling/trie/comparable.rbs', line 12 def value: -> TValue? |