Sha256: 24c080f5145afa8b409ef98d6b80990ec5c726ec2e10494f1ce5ca6af35ca6c6

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

# unpack data dictionary information section
# Reader - ADIwg JSON V1 to internal data structure

# History:
# 	Stan Smith 2013-12-01 original script

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

module Md_DictionaryInfo

	def self.unpack(hDictInfo)

		# instance classes needed in script
		intMetadataClass = InternalMetadata.new
		intDictInfo = intMetadataClass.newDictionaryInfo

		# dictionary info - citation
		if hDictInfo.has_key?('citation')
			hCitation = hDictInfo['citation']
			unless hCitation.empty?
				intDictInfo[:dictCitation] = Md_Citation.unpack(hCitation)
			end
		end

		# dictionary info - description
		if hDictInfo.has_key?('description')
			s = hDictInfo['description']
			if s != ''
				intDictInfo[:dictDescription] = s
			end
		end

		# dictionary info - resource type
		if hDictInfo.has_key?('resourceType')
			s = hDictInfo['resourceType']
			if s != ''
				intDictInfo[:dictResourceType] = s
			end
		end

		# dictionary info - language
		if hDictInfo.has_key?('language')
			s = hDictInfo['language']
			if s != ''
				intDictInfo[:dictLanguage] = s
			end
		end

		return intDictInfo
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb