Class: CaseGen::Output
- Inherits:
-
Object
- Object
- CaseGen::Output
- Includes:
- RuleDescription
- Defined in:
- lib/case_gen/output.rb
Direct Known Subclasses
Exclude, ExcludeAsTable, ExcludeAsText, ExcludeInline, ExcludeInlineFootnotes
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(generator) ⇒ Output
constructor
A new instance of Output.
- #to_s ⇒ Object
Methods included from RuleDescription
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_s ⇒ Object
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 |