Class: CaseGen::Generator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sets, rules) ⇒ Generator

Returns a new instance of Generator.



9
10
11
12
13
14
15
16
# File 'lib/case_gen/generator.rb', line 9

def initialize(sets, rules)
  @sets = sets.map do |title, values|
    CaseGen::Set.new(title, values)
  end
  @rules = rules
  @combos = generate_combinations
  apply_rules
end

Instance Attribute Details

#combosObject (readonly)

Returns the value of attribute combos.



7
8
9
# File 'lib/case_gen/generator.rb', line 7

def combos
  @combos
end

#exclusionsObject (readonly)

Returns the value of attribute exclusions.



7
8
9
# File 'lib/case_gen/generator.rb', line 7

def exclusions
  @exclusions
end

#rulesObject (readonly)

Returns the value of attribute rules.



7
8
9
# File 'lib/case_gen/generator.rb', line 7

def rules
  @rules
end

#setsObject (readonly)

Returns the value of attribute sets.



7
8
9
# File 'lib/case_gen/generator.rb', line 7

def sets
  @sets
end