Module: Adiwg_ResponsibleParty

Defined in:
lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_responsibleParty.rb

Overview

History: Stan Smith 2013-08-26 original script

Stan Smith 2014-05-28 modified to support JSON schema 0.5.0
... removed resource IDs associated with contact

Class Method Summary collapse

Class Method Details

.unpack(hRParty) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_responsibleParty.rb', line 11

def self.unpack(hRParty)

  # instance classes needed in script
  intMetadataClass = .new
  intResById = intMetadataClass.newRespParty

  # responsible party - contact
  if hRParty.has_key?('contactId')
    s = hRParty['contactId']
    if s != ''
      intResById[:contactID] = s
    end
  end

  # responsible party - role - required
  if hRParty.has_key?('role')
    s = hRParty['role']
    if s != ''
      intResById[:roleName] = s
    end
  end

  return intResById

end