Class: ADIWG::Mdtranslator::Writers::Iso19115_2::RS_Identifier
- Inherits:
-
Object
- Object
- ADIWG::Mdtranslator::Writers::Iso19115_2::RS_Identifier
- Defined in:
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb
Instance Method Summary collapse
-
#initialize(xml, hResponseObj) ⇒ RS_Identifier
constructor
A new instance of RS_Identifier.
- #writeXML(hIdentifier, inContext = nil) ⇒ Object
Constructor Details
#initialize(xml, hResponseObj) ⇒ RS_Identifier
Returns a new instance of RS_Identifier.
25 26 27 28 29 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb', line 25 def initialize(xml, hResponseObj) @xml = xml @hResponseObj = hResponseObj @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2 end |
Instance Method Details
#writeXML(hIdentifier, inContext = nil) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb', line 31 def writeXML(hIdentifier, inContext = nil) outContext = 'identifier' outContext = inContext + ' authority' unless inContext.nil? # classes used in MD_Metadata citationClass = CI_Citation.new(@xml, @hResponseObj) @xml.tag!('gmd:RS_Identifier') do # identifier - authority {CI_Citation} hCitation = hIdentifier[:citation] unless hCitation.empty? @xml.tag!('gmd:authority') do citationClass.writeXML(hCitation, outContext) end end if hCitation.empty? && @hResponseObj[:writerShowTags] @xml.tag!('gmd:authority') end # identifier - code (required) s = hIdentifier[:identifier] unless s.nil? @xml.tag!('gmd:code') do @xml.tag!('gco:CharacterString', s) end end if s.nil? @NameSpace.issueWarning(230, 'gmd:code', inContext) end # identifier - codeSpace s = hIdentifier[:namespace] unless s.nil? @xml.tag!('gmd:codeSpace') do @xml.tag!('gco:CharacterString', s) end end if s.nil? && @hResponseObj[:writerShowTags] @xml.tag!('gmd:codeSpace') end # identifier - codeSpace version s = hIdentifier[:version] unless s.nil? @xml.tag!('gmd:version') do @xml.tag!('gco:CharacterString', s) end end if s.nil? && @hResponseObj[:writerShowTags] @xml.tag!('gmd:version') end end # RS_Identifier tag end |