Module: ADIWG::Mdtranslator::Readers::MdJson::EvaluationMethod

Defined in:
lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb

Class Method Summary collapse

Class Method Details

.unpack(hMethod, responseObj, inContext = nil) ⇒ Object



9
10
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
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
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb', line 9

def self.unpack(hMethod, responseObj, inContext = nil)

  intMetadataClass = InternalMetadata.new
  intMethod = intMetadataClass.newEvaluationMethod

  # type: nil,
  if hMethod.has_key?('type')
    intMethod[:type] = hMethod['type']
  end

  # dateTime: [],
  if hMethod.has_key?('dateTime')
     intMethod[:dateTime] = hMethod['dateTime']
  end

  # methodDescription: nil,
  if hMethod.has_key?('methodDescription')
   intMethod[:methodDescription] = hMethod['methodDescription']
  end

  # evaluationProcedure: {},
  if hMethod.has_key?('evaluationProcedure')
    intMethod[:evaluationProcedure] = Citation.unpack(hMethod['evaluationProcedure'], responseObj)
  end

  # referenceDocuments: [],
  if hMethod.has_key?('referenceDocuments')

    hMethod['referenceDocuments'].each do |item|
      hReturn = Citation.unpack(item, responseObj)
      unless hReturn.nil?
        intMethod[:referenceDocuments] << hReturn
      end
    end

    intMethod[:referenceDocuments] = hMethod['referenceDocuments']
  end

  # evaluationMethodType: nil,
  if hMethod.has_key?('evaluationMethodType')
    intMethod[:evaluationMethodType] = hMethod['evaluationMethodType']
  end

  # deductiveSource: nil,
  if hMethod.has_key?('deductiveSource')
    intMethod[:deductiveSource] = hMethod['deductiveSource']
  end

  # samplingScheme: nil,
  if hMethod.has_key?('samplingScheme')
    intMethod[:samplingScheme] = hMethod['samplingScheme']
  end

  # lotDescription: nil,
  if hMethod.has_key?('lotDescription')
    intMethod[:lotDescription] = hMethod['lotDescription']
  end

  # samplingRatio: nil
  if hMethod.has_key?('samplingRatio')
    intMethod[:samplingRatio] = hMethod['samplingRatio']
  end

  return intMethod

end