Sha256: 0f812e332a5d538e72ed65dd09a0ad77935b96c180740d8c7bca06b609125361

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

# unpack lineage
# Reader - ADIwg JSON V1 to internal data structure

# History:
# 	Stan Smith 2013-11-26 original script
#   Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module

require ADIWG::Mdtranslator.reader_module('module_processStep', $response[:readerVersionUsed])
require ADIWG::Mdtranslator.reader_module('module_source', $response[:readerVersionUsed])

module Adiwg_Lineage

	def self.unpack(hLineage)

		# instance classes needed in script
		intMetadataClass = InternalMetadata.new
		intDataLine = intMetadataClass.newLineage

		# lineage - statement
		if hLineage.has_key?('statement')
			s = hLineage['statement']
			if s != ''
				intDataLine[:statement] = s
			end
		end

		# lineage - process steps
		if hLineage.has_key?('processStep')
			aProcSteps = hLineage['processStep']
			unless aProcSteps.empty?
				aProcSteps.each do |hProcStep|
					intDataLine[:processSteps] << Adiwg_ProcessStep.unpack(hProcStep)
				end
			end
		end

		# lineage - data sources
		if hLineage.has_key?('source')
			aSources = hLineage['source']
			unless aSources.empty?
				aSources.each do |hSource|
					intDataLine[:dataSources] << Adiwg_Source.unpack(hSource)
				end
			end
		end

		return intDataLine
	end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_lineage.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.8.0/module_lineage.rb