Version 0.4.2 of the Rambling Trie has been released!

July 28, 2012

This post was originally published in the Rambling Labs Blog on July 28, 2012.

The Rambling Trie has reached its 0.4.2 version. This one includes the before mentioned changes for the trie instance to behave as an Enumerable.

This means that having this:

trie = Rambling::Trie.create
(%w(some words and other stuff)).each |word|
  trie << word

You can do something like this:

trie.each do |word|
  puts "#{word} is included!"

As well as:

trie.any? { |word| word.include? 'x' }
trie.all? { |word| word.length > 0 }

And any other method included in Ruby core’s Enumerable module. Isn’t that cool!?