Class: DEBUGGER__::AbbrevCommand::TrieNode
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/debug/abbrev_command.rb |
Class Method Summary
- .new ⇒ TrieNode constructor
Instance Method Summary
Constructor Details
.new ⇒ TrieNode
# File 'lib/debug/abbrev_command.rb', line 5
def initialize @children = {} @types = {} # set end
Instance Method Details
#[](c)
[ GitHub ]# File 'lib/debug/abbrev_command.rb', line 15
def [](c) @children[c] end
#add_type(type)
[ GitHub ]#append(c, type)
[ GitHub ]#candidates
[ GitHub ]# File '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
[ GitHub ]# File 'lib/debug/abbrev_command.rb', line 28
def type if @types.size == 1 @types.keys.first else nil end end
#types
[ GitHub ]# File 'lib/debug/abbrev_command.rb', line 24
def types @types.keys end