Sha256: d1dbc45ec55796d377423e782a6a694be6530e138219b2d367bf90d63739c343
Contents?: true
Size: 763 Bytes
Versions: 12
Compression:
Stored size: 763 Bytes
Contents
# frozen_string_literal: true module Rambling module Trie # Provides pretty printing behavior for the trie data structure. module Inspectable # @return [String] a string representation of the current node. def inspect "#<#{class_name} #{attributes}>" end private def class_name self.class.name end def attributes [ letter_inspect, terminal_inspect, children_inspect, ].join ', ' end def letter_inspect "letter: #{letter.inspect}" end def terminal_inspect "terminal: #{terminal.inspect}" end def children_inspect "children: #{children_tree.keys.inspect}" end end end end
Version data entries
12 entries across 12 versions & 2 rubygems