Sha256: 2bda4aac4aac56714bae7afcbeb4e9471c4d5d6f4d51c6d6fcc74b3024f1d716

Contents?: true

Size: 1.54 KB

Versions: 35

Compression:

Stored size: 1.54 KB

Contents

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

# History:
#  Stan Smith 2018-06-25 refactored error and warning messaging
# 	Stan Smith 2016-11-02 original script

module ADIWG
   module Mdtranslator
      module Readers
         module MdJson

            module Schema

               def self.unpack(hSchema, responseObj)

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

                  # return nil object if input is empty
                  if hSchema.empty?
                     @MessagePath.issueError(720, responseObj)
                     return nil
                  end

                  # instance classes needed in script
                  intMetadataClass = InternalMetadata.new
                  intSchema = intMetadataClass.newSchema

                  # schema - name (required)
                  if hSchema.has_key?('name')
                     intSchema[:name] = hSchema['name']
                  end
                  if intSchema[:name].nil? || intSchema[:name] == ''
                     @MessagePath.issueError(721, responseObj)
                  end

                  # schema - version (required)
                  if hSchema.has_key?('version')
                     intSchema[:version] = hSchema['version']
                  end
                  if intSchema[:version].nil? || intSchema[:version] == ''
                     @MessagePath.issueWarning(722, responseObj)
                  end

                  return intSchema

               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_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb