| Class | Batfish::Trie |
| In: |
lib/data/trie.rb
|
| Parent: | Object |
| root | [R] |
Returns true if the trie is empty.
# File lib/data/trie.rb, line 62 def empty? return @root.children.empty? ? true : false end
Returns the value associated with the given key. Returns nil if it is not found.
# File lib/data/trie.rb, line 41 def fetch(key) @root.fetch(key.upcase.split("")) end
Returns true if the trie contains the given key.
# File lib/data/trie.rb, line 48 def has_key?(key) return self.fetch(key) ? true : false end