Module: Adiwg_Lineage

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

Class Method Summary collapse

Class Method Details

.unpack(hLineage) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_lineage.rb', line 13

def self.unpack(hLineage)

  # instance classes needed in script
  intMetadataClass = .new
  intDataLine = intMetadataClass.newLineage

  # lineage - statement
  if hLineage.has_key?('statement')
    s = hLineage['statement']
    if s != ''
      intDataLine[:statement] = s
    end
  end

  # lineage - process steps
  if hLineage.has_key?('processStep')
    aProcSteps = hLineage['processStep']
    unless aProcSteps.empty?
      aProcSteps.each do |hProcStep|
        intDataLine[:processSteps] << Adiwg_ProcessStep.unpack(hProcStep)
      end
    end
  end

  # lineage - data sources
  if hLineage.has_key?('source')
    aSources = hLineage['source']
    unless aSources.empty?
      aSources.each do |hSource|
        intDataLine[:dataSources] << Adiwg_Source.unpack(hSource)
      end
    end
  end

  return intDataLine
end