Module: Adiwg_ProcessStep

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

Class Method Summary collapse

Class Method Details

.unpack(hProcStep) ⇒ 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/adiwg/mdtranslator/readers/adiwgJson/modules_0.9.0/module_processStep.rb', line 13

def self.unpack(hProcStep)

  # instance classes needed in script
  intMetadataClass = .new
  intDataPStep = intMetadataClass.newDataProcessStep

  # process step - step ID
  if hProcStep.has_key?('stepId')
    s = hProcStep['stepId']
    if s != ''
      intDataPStep[:stepID] = s
    end
  end

  # process step - description
  if hProcStep.has_key?('description')
    s = hProcStep['description']
    if s != ''
      intDataPStep[:stepDescription] = s
    end
  end

  # process step - rationale
  if hProcStep.has_key?('rationale')
    s = hProcStep['rationale']
    if s != ''
      intDataPStep[:stepRationale] = s
    end
  end

  # process step - dateTime
  if hProcStep.has_key?('dateTime')
    s = hProcStep['dateTime']
    if s != ''
      intDataPStep[:stepDateTime] = Adiwg_DateTime.unpack(s)
    end
  end

  # process step - step processors
  if hProcStep.has_key?('processor')
    aProcessors = hProcStep['processor']
    unless aProcessors.empty?
      aProcessors.each do |processor|
        intDataPStep[:stepProcessors] << Adiwg_ResponsibleParty.unpack(processor)
      end
    end
  end

  return intDataPStep
end