class DEBUGGER__::AbbrevCommand::TrieNode
Public Class Methods
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 5 def initialize @children = {} @types = {} # set end
Public Instance Methods
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 15 def [](c) @children[c] end
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 19 def add_type type @types[type] = true self end
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 10 def append c, type trie = (@children[c] ||= TrieNode.new) trie.add_type type end
Source
# File bundled-src/debug-1.11.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
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 28 def type if @types.size == 1 @types.keys.first else nil end end
Source
# File bundled-src/debug-1.11.1/lib/debug/abbrev_command.rb, line 24 def types @types.keys end