Module: DTK::DSL::InputOutputCommon::OutputClassMixin

Included in:
FileGenerator::YamlObject, FileParser::Output
Defined in:
lib/dsl/input_output_common/output_class_mixin.rb

Instance Method Summary collapse

Instance Method Details

#create(opts = {}) ⇒ Object

opts can have keys

:output_type
:input

In both cases an empty object is created using :output_type or type of :input to determine its type



25
26
27
28
29
30
31
# File 'lib/dsl/input_output_common/output_class_mixin.rb', line 25

def create(opts = {})
  unless opts[:output_type] or opts[:input]
    raise Error, "opts must have one of the keys :output_type or :input"
  end
  obj_type = opts[:output_type] || obj_type(opts[:input])
  create_aux(obj_type)
end