Class: Elus::Turn2Generator
- Defined in:
- lib/elus/generator.rb
Instance Method Summary collapse
Methods inherited from Generator
Instance Method Details
#generate_rules ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/elus/generator.rb', line 27 def generate_rules conditions = permutate('1') branches = permutate.map {|code| [code, Piece.different(code)]} conditions.product(branches.uniq).map do |condition, yes_no| yes,no = yes_no Rule.new(Piece.create(condition), Piece.create(yes), Piece.create(no)) end end |