Class: MD_MediumFormatCode

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_mediumFormat.rb

Overview

from www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml History: Stan Smith 2013-09-24 original script

Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ MD_MediumFormatCode

Returns a new instance of MD_MediumFormatCode.



10
11
12
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_mediumFormat.rb', line 10

def initialize(xml)
	@xml = xml
end

Instance Method Details

#writeXML(codeName) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_mediumFormat.rb', line 14

def writeXML(codeName)
	case(codeName)
		when 'cpio' then codeID = '001'
		when 'tar' then codeID = '002'
		when 'highSierra' then codeID = '003'
		when 'iso9660' then codeID = '004'
		when 'iso9660RockRidge' then codeID = '005'
		when 'iso9660AppleHFS' then codeID = '006'
		else
			codeID = 'non-ISO codeName'
	end

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