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:



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

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