Class: Node

Inherits:
Object
  • Object
show all
Defined in:
lib/pretree.rb

Overview

Prefix tree (Node class)

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nextObject (readonly)

Returns the value of attribute next.



7
8
9
# File 'lib/pretree.rb', line 7

def next
  @next
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/pretree.rb', line 7

def value
  @value
end

#wordObject

Returns the value of attribute word.



8
9
10
# File 'lib/pretree.rb', line 8

def word
  @word
end