Sha256: 82fb83fb2dc1651ea23815e6284e96732c1553d79ca109b23bffa6ec3c441fcf
Contents?: true
Size: 1.63 KB
Versions: 4
Compression:
Stored size: 1.63 KB
Contents
# unpack resourceType # Reader - ADIwg JSON to internal data structure # History: # Stan Smith 2018-02-19 refactored error and warning messaging # Stan Smith 2017-02-15 original script module ADIWG module Mdtranslator module Readers module MdJson module ResourceType def self.unpack(hType, responseObj) # return nil object if input is empty if hType.empty? responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: resource type object is empty' return nil end # instance classes needed in script intMetadataClass = InternalMetadata.new intType = intMetadataClass.newResourceType # resource type - type (required) {MD_ScopeCode} if hType.has_key?('type') unless hType['type'] == '' intType[:type] = hType['type'] end end if intType[:type].nil? responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: resource type is missing' responseObj[:readerExecutionPass] = false return nil end # resource type - name if hType.has_key?('name') unless hType['name'] == '' intType[:name] = hType['name'] end end return intType end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems