Class: MD_KeywordTypeCode
- Inherits:
-
Object
- Object
- MD_KeywordTypeCode
- Defined in:
- lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_keywordType.rb
Overview
from www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml History: Stan Smith 2013-09-18 original script
Stan Smith 2014-10-15 allow non-ISO codesNames to be rendered
Instance Method Summary collapse
-
#initialize(xml) ⇒ MD_KeywordTypeCode
constructor
A new instance of MD_KeywordTypeCode.
- #writeXML(codeName) ⇒ Object
Constructor Details
#initialize(xml) ⇒ MD_KeywordTypeCode
Returns a new instance of MD_KeywordTypeCode.
10 11 12 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_keywordType.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 31 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/codelists/code_keywordType.rb', line 14 def writeXML(codeName) case(codeName) when 'discipline' then codeID = '001' when 'place' then codeID = '002' when 'stratum' then codeID = '003' when 'temporal' then codeID = '004' when 'theme' then codeID = '005' when 'taxon' then codeID = '006' when 'instrument' then codeID = 'ADIwg-001' else codeID = 'non-ISO codeName' end # write xml @xml.tag!('gmd:MD_KeywordTypeCode',{:codeList=>'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode', :codeListValue=>"#{codeName}", :codeSpace=>"#{codeID}"}) end |