Class: CaseGen::Output

Inherits:
Object
  • Object
show all
Includes:
RuleDescription
Defined in:
lib/case_gen/output.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RuleDescription

#rule_description

Constructor Details

#initialize(generator) ⇒ Output

Returns a new instance of Output.



12
13
14
# File 'lib/case_gen/output.rb', line 12

def initialize(generator)
  @generator = generator
end

Class Method Details

.create(generator, output_type = :exclude) ⇒ Object



5
6
7
8
# File 'lib/case_gen/output.rb', line 5

def self.create(generator, output_type = :exclude)
  klass_name = output_type.to_s.split('_').map(&:capitalize).join.to_s
  Object.const_get("CaseGen::#{klass_name}").new(generator)
end

Instance Method Details

#to_sObject



16
17
18
19
20
# File 'lib/case_gen/output.rb', line 16

def to_s
  update_excluded_values
  include, exclude = partition_exclusions
  as_table(include).tap { |o| o << exclude_output(exclude) }
end