Class: Zenlish::Trie::TrieNode
- Inherits:
-
BaseTrieNode
- Object
- BaseTrieNode
- Zenlish::Trie::TrieNode
- Defined in:
- lib/zenlish/trie/trie_node.rb
Instance Attribute Summary collapse
-
#key ⇒ String
readonly
The matching character.
-
#value ⇒ Object, NilClass
Result when this character matches end-of-word.
Attributes inherited from BaseTrieNode
Instance Method Summary collapse
-
#initialize(aChar) ⇒ TrieNode
constructor
A new instance of TrieNode.
Methods inherited from BaseTrieNode
Constructor Details
#initialize(aChar) ⇒ TrieNode
Returns a new instance of TrieNode.
14 15 16 17 18 |
# File 'lib/zenlish/trie/trie_node.rb', line 14 def initialize(aChar) super() @key = aChar @value = nil end |
Instance Attribute Details
#key ⇒ String (readonly)
Returns the matching character.
9 10 11 |
# File 'lib/zenlish/trie/trie_node.rb', line 9 def key @key end |
#value ⇒ Object, NilClass
Returns Result when this character matches end-of-word.
12 13 14 |
# File 'lib/zenlish/trie/trie_node.rb', line 12 def value @value end |