module ADIWG::Mdtranslator::Readers::Fgdc::Responsibility

Public Class Methods

unpack(aContacts, role, hResponseObj) click to toggle source
# File lib/adiwg/mdtranslator/readers/fgdc/modules/module_responsibility.rb, line 17
def self.unpack(aContacts, role, hResponseObj)

   # instance classes needed in script
   intMetadataClass = InternalMetadata.new
   hResponsibility = intMetadataClass.newResponsibility

   hResponsibility[:roleName] = role

   # add contacts to responsibility party []
   aContacts.each do |contactId|
      hContactInfo = Fgdc.find_contact_by_id(contactId)
      unless hContactInfo[0].nil?
         hParty = intMetadataClass.newParty
         hParty[:contactId] = contactId
         hParty[:contactIndex] = hContactInfo[0]
         hParty[:contactType] = hContactInfo[1]
         hResponsibility[:parties] << hParty
      end
   end

   return hResponsibility

end