Class: Wordlist::Operators::Product
- Inherits:
-
BinaryOperator
- Object
- Operator
- BinaryOperator
- Wordlist::Operators::Product
- Defined in:
- lib/wordlist/operators/product.rb
Overview
Lazily enumerates over the combination of the words from two wordlists.
Instance Attribute Summary
Attributes inherited from BinaryOperator
Instance Method Summary collapse
-
#each {|string| ... } ⇒ Enumerator
Enumerates over every combination of the words from the two wordlist.
Methods inherited from BinaryOperator
Constructor Details
This class inherits a constructor from Wordlist::Operators::BinaryOperator
Instance Method Details
#each {|string| ... } ⇒ Enumerator
Enumerates over every combination of the words from the two wordlist.
39 40 41 42 43 44 45 46 47 |
# File 'lib/wordlist/operators/product.rb', line 39 def each return enum_for(__method__) unless block_given? @left.each do |word1| @right.each do |word2| yield word1 + word2 end end end |