Sha256: 4dbdab4cafe6187a7e0138abc517b57808763ee2290e0778c5f93888e6d52a29

Contents?: true

Size: 979 Bytes

Versions: 4

Compression:

Stored size: 979 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
#   Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered

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
				codeID = 'non-ISO codeName'
		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

4 entries across 4 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_restriction.rb