Module: ADIWG::Mdtranslator::Writers::SbJson::ParentId

Defined in:
lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_parentId.rb

Class Method Summary collapse

Class Method Details

.build(hCitation) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_parentId.rb', line 14

def self.build(hCitation)

   # return identifier as parentId where namespace = 'gov.sciencebase.catalog'
   hCitation[:identifiers].each do |hIdentifier|
      unless hIdentifier[:namespace].nil?
         if hIdentifier[:namespace] == 'gov.sciencebase.catalog'
            return hIdentifier[:identifier]
         end
      end
   end

   return nil

end