Module: Adiwg_AdditionalDocumentation

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

Class Method Summary collapse

Class Method Details

.unpack(hAddDoc) ⇒ 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
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_additionalDocumentation.rb', line 11

def self.unpack(hAddDoc)

  # instance classes needed in script
  intMetadataClass = .new
  intAddDoc = intMetadataClass.newAssociatedResource

  # associated resource - resource type
  if hAddDoc.has_key?('resourceType')
    s = hAddDoc['resourceType']
    if s != ''
      intAddDoc[:resourceType] = s
    end
  end

  # associated resource - resource citation
  if hAddDoc.has_key?('citation')
    hCitation = hAddDoc['citation']
    unless hCitation.empty?
      intAddDoc[:citation] = Adiwg_Citation.unpack(hCitation)
    end
  end

  return intAddDoc
end