Class: Elus::Generator

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

Overview

Rules Generators

Instance Method Summary collapse

Instance Method Details

#generate_rulesObject



4
5
6
# File 'lib/elus/generator.rb', line 4

def generate_rules
  []
end

#permutate(string = '01!=') ⇒ Object

iterates through all permutations of string chars with 2 dots



9
10
11
# File 'lib/elus/generator.rb', line 9

def permutate(string='01!=')
  string.split(//).product(['.'],['.']).map {|set| set.permutation.to_a.uniq}.flatten(1).map {|chars| chars.join}
end