Class: PrefixTreeNode
- Inherits:
-
Object
- Object
- PrefixTreeNode
- Defined in:
- lib/prefix_tree_node.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#is_end ⇒ Object
Returns the value of attribute is_end.
-
#next ⇒ Object
readonly
Returns the value of attribute next.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#word ⇒ Object
Returns the value of attribute word.
Instance Method Summary collapse
-
#initialize(value) ⇒ PrefixTreeNode
constructor
A new instance of PrefixTreeNode.
Constructor Details
#initialize(value) ⇒ PrefixTreeNode
Returns a new instance of PrefixTreeNode.
7 8 9 10 11 12 |
# File 'lib/prefix_tree_node.rb', line 7 def initialize(value) @value = value @word = false @next = [] @children = Array.new(26) end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
5 6 7 |
# File 'lib/prefix_tree_node.rb', line 5 def children @children end |
#is_end ⇒ Object
Returns the value of attribute is_end.
5 6 7 |
# File 'lib/prefix_tree_node.rb', line 5 def is_end @is_end end |
#next ⇒ Object (readonly)
Returns the value of attribute next.
4 5 6 |
# File 'lib/prefix_tree_node.rb', line 4 def next @next end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/prefix_tree_node.rb', line 4 def value @value end |
#word ⇒ Object
Returns the value of attribute word.
5 6 7 |
# File 'lib/prefix_tree_node.rb', line 5 def word @word end |