Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/pretree.rb
Overview
Prefix tree (Node class)
Instance Attribute Summary collapse
-
#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) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 |
# File 'lib/pretree.rb', line 10 def initialize(value) @value = value @word = false @next = [] end |
Instance Attribute Details
#next ⇒ Object (readonly)
Returns the value of attribute next.
7 8 9 |
# File 'lib/pretree.rb', line 7 def next @next end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/pretree.rb', line 7 def value @value end |
#word ⇒ Object
Returns the value of attribute word.
8 9 10 |
# File 'lib/pretree.rb', line 8 def word @word end |