Method: Wordlist::ListMethods#product

Defined in:
lib/wordlist/list_methods.rb

#product(other) ⇒ Operators::Product Also known as: *

Lazily enumerates over the combination of the words from two wordlists.

Examples:

wordlist1 = Wordlist::Words["foo", "bar"]
wordlist2 = Wordlist::Words["ABC", "XYZ"]
(wordlist1 * wordlist2).each do |word|
  puts word
end
# fooABC
# fooXYZ
# barABC
# barXYZ

Since:

  • 1.0.0



94
95
96
# File 'lib/wordlist/list_methods.rb', line 94

def product(other)
  Operators::Product.new(self,other)
end