class RubyTrie::TrieContent
the content of a TrieNode
Attributes
string[R]
symbol at the node, and the entire string to this node are held
symbol[R]
symbol at the node, and the entire string to this node are held
value[RW]
value can be overwritten
Public Class Methods
new(str, value=nil)
click to toggle source
Initialize with the full string (not just the symbol) and an optional value You should not need to use this class unless you start walking the Trie
# File lib/ruby_trie.rb, line 28 def initialize(str, value=nil) @string = str @symbol = str[-1] @value = value end
Public Instance Methods
to_a()
click to toggle source
turn the content into a [symbol, string, value] array
# File lib/ruby_trie.rb, line 35 def to_a [@symbol, @string, @value] end