Class: Etna::Cwl::RecordType

Inherits:
Etna::Cwl show all
Defined in:
lib/etna/cwl.rb

Defined Under Namespace

Classes: Field, Record, RecordTypeLoader

Constant Summary

Constants inherited from Etna::Cwl

FIELD_LOADERS

Instance Method Summary collapse

Methods inherited from Etna::Cwl

#as_json, as_json, #initialize, load_item, loader

Constructor Details

This class inherits a constructor from Etna::Cwl

Instance Method Details

#type_loaderObject



368
369
370
371
372
373
374
375
376
377
# File 'lib/etna/cwl.rb', line 368

def type_loader
  @type_loader ||= begin
    record_class = Class.new(Record)
    RecordLoader.new(record_class, @attributes['fields'].map do |field|
      loader = Field.type_loader(field.type)
      return nil if loader.nil?
      [field.name.to_sym, loader]
    end.to_h)
  end
end