module ADIWG::Mdtranslator::Readers::SbJson::Id

Public Class Methods

unpack(hSbJson, hResponseObj) click to toggle source
# File lib/adiwg/mdtranslator/readers/sbJson/modules/module_id.rb, line 16
def self.unpack(hSbJson, hResponseObj)

   # instance classes needed in script
   intMetadataClass = InternalMetadata.new

   if hSbJson.has_key?('id')
      hIdentifier = intMetadataClass.newIdentifier

      sbId = hSbJson['id']
      unless sbId.nil? || sbId == ''
         hIdentifier[:identifier] = sbId
         hIdentifier[:namespace] = 'gov.sciencebase.catalog'
         hIdentifier[:description] = 'USGS ScienceBase Identifier'
         return hIdentifier
      end
   end

   return nil

end