Sha256: 9ef634cc805463593caf3df7ea54f3065009dcf625d42990b5743e39e3bfc95f

Contents?: true

Size: 937 Bytes

Versions: 3

Compression:

Stored size: 937 Bytes

Contents

# ISO <<CodeLists>> gmd:MD_RestrictionCode

# from http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
# History:
# 	Stan Smith 2013-10-21 original script

class MD_RestrictionCode
	def initialize(xml)
		@xml = xml
	end

	def writeXML(codeName)
		case(codeName)
			when 'copyright' then codeID = '001'
			when 'patent' then codeID = '002'
			when 'patentPending' then codeID = '003'
			when 'trademark' then codeID = '004'
			when 'license' then codeID = '005'
			when 'intellectualPropertyRights' then codeID = '006'
			when 'restricted' then codeID = '007'
			when 'otherRestrictions' then codeID = '008'
			else
				codeName = 'INVALID RESTRICTION'
				codeID = '999'
		end

		# write xml
		@xml.tag!('gmd:MD_RestrictionCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_RestrictionCode',
											 :codeListValue=>"#{codeName}",
											 :codeSpace=>"#{codeID}"})
	end

end





Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb