Sha256: 6cdfdc8695eb2f5f12b3339597ccb6bf51113b2ce3e2d1a6df9e74b4206680c2

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

module Rambling
  module Trie
    # Provides the comparable behavior for the trie data structure.
    module Comparable
      # Compares two nodes.
      # @param [Nodes::Node] other the node to compare against.
      # @return [Boolean] `true` if the nodes' {Nodes::Node#letter #letter} and
      #   {Nodes::Node#children_tree #children_tree} are equal, `false` otherwise.
      def == other
        letter == other.letter &&
          terminal? == other.terminal? &&
          children_tree == other.children_tree
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rambling-trie-1.0.3 lib/rambling/trie/comparable.rb