Sha256: 9fb8e3a382748ee698666320bddf3f60a481ec17e6342c08488309a71c31086f

Contents?: true

Size: 1.55 KB

Versions: 35

Compression:

Stored size: 1.55 KB

Contents

# unpack resourceType
# Reader - ADIwg JSON to internal data structure

# History:
#  Stan Smith 2018-06-24 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, inContext = nil)

                  @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson

                  # return nil object if input is empty
                  if hType.empty?
                     @MessagePath.issueWarning(690, responseObj, inContext)
                     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?
                     @MessagePath.issueError(691, responseObj, inContext)
                  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

35 entries across 35 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb