class DEBUGGER__::AbbrevCommand::TrieNode

Public Class Methods

new() click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 5
def initialize
  @children = {}
  @types = {} # set
end

Public Instance Methods

[](c) click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 15
def [](c)
  @children[c]
end
add_type(type) click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 19
def add_type type
  @types[type] = true
  self
end
append(c, type) click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 10
def append c, type
  trie = (@children[c] ||= TrieNode.new)
  trie.add_type type
end
candidates() click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 36
def candidates
  @children.map{|c, n|
    ss = n.candidates
    ss.empty? ? c :
    ss.map{|s|
      c+s
    }
  }.flatten
end
type() click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 28
def type
  if @types.size == 1
    @types.keys.first
  else
    nil
  end
end
types() click to toggle source
# File debug-1.9.1/lib/debug/abbrev_command.rb, line 24
def types
  @types.keys
end