add TRIE implementation using classes in ruby