Module: Rambling::Trie::Comparable

Included in:
Nodes::Node
Defined in:
lib/rambling/trie/comparable.rb

Overview

Provides the comparable behavior for the trie data structure.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Compares two nodes.

Parameters:

Returns:



11
12
13
14
15
# File 'lib/rambling/trie/comparable.rb', line 11

def == other
  letter == other.letter &&
    terminal? == other.terminal? &&
    children_tree == other.children_tree
end