Rambling Labs Blog Ramblings on software development

  • Version 0.4.2 of the Rambling Trie has been released!

    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!?


  • blog comments powered by Disqus