Sha256: 4c08ae3695715d02e3e281c8985fe31e4a1161fe7fa29824c752c38195c55ff6
Contents?: true
Size: 1.81 KB
Versions: 31
Compression:
Stored size: 1.81 KB
Contents
# unpack vector representation # Reader - ADIwg JSON to internal data structure # History: # Stan Smith 2016-10-19 original script require_relative 'module_vectorObject' module ADIWG module Mdtranslator module Readers module MdJson module VectorRepresentation def self.unpack(hVector, responseObj) # return nil object if input is empty if hVector.empty? responseObj[:readerExecutionMessages] << 'Vector Representation object is empty' responseObj[:readerExecutionPass] = false return nil end # instance classes needed in script intMetadataClass = InternalMetadata.new intVector = intMetadataClass.newVectorInfo # vector representation - topology level if hVector.has_key?('topologyLevel') if hVector['topologyLevel'] != '' intVector[:topologyLevel] = hVector['topologyLevel'] end end # vector representation - vector object [] if hVector.has_key?('vectorObject') hVector['vectorObject'].each do |item| hVec = VectorObject.unpack(item, responseObj) unless hVec.nil? intVector[:vectorObject] << hVec end end end return intVector end end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems