Class: Containers::Trie::Node

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

Overview

:nodoc: all

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(char, value) ⇒ Node

Returns a new instance of Node.



107
108
109
110
111
112
# File 'lib/containers/trie.rb', line 107

def initialize(char, value)
  @char = char
  @value = value
  @left = @mid = @right = nil
  @end = false
end

Instance Attribute Details

#charObject

Returns the value of attribute char.



105
106
107
# File 'lib/containers/trie.rb', line 105

def char
  @char
end

#endObject

Returns the value of attribute end.



105
106
107
# File 'lib/containers/trie.rb', line 105

def end
  @end
end

#leftObject

Returns the value of attribute left.



105
106
107
# File 'lib/containers/trie.rb', line 105

def left
  @left
end

#midObject

Returns the value of attribute mid.



105
106
107
# File 'lib/containers/trie.rb', line 105

def mid
  @mid
end

#rightObject

Returns the value of attribute right.



105
106
107
# File 'lib/containers/trie.rb', line 105

def right
  @right
end

#valueObject

Returns the value of attribute value.



105
106
107
# File 'lib/containers/trie.rb', line 105

def value
  @value
end

Instance Method Details

#last?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/containers/trie.rb', line 114

def last?
  @end == true
end