Class: Elus::Turn3Generator

Inherits:
Generator show all
Defined in:
lib/elus/generator.rb

Instance Method Summary collapse

Methods inherited from Generator

#permutate

Instance Method Details

#generate_rulesObject



38
39
40
41
42
43
44
45
# File 'lib/elus/generator.rb', line 38

def generate_rules
  conditions = permutate('1')
  yes_branches = permutate
  no_branches = permutate
  conditions.product(yes_branches, no_branches).map  do|condition, yes, no| 
    Rule.new(Piece.create(condition), Piece.create(yes), Piece.create(no))
  end  
end