Module: ADIWG::Mdtranslator::Writers::MdJson::CoverageItem

Defined in:
lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb

Class Method Summary collapse

Class Method Details

.build(intObj) ⇒ Object



8
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
# File 'lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb', line 8

def self.build(intObj)
  Jbuilder.new do |json|
    json.itemName intObj[:itemName]
    json.itemType intObj[:itemType]
    json.itemDescription intObj[:itemDescription]
    json.minValue intObj[:minValue]
    json.maxValue intObj[:maxValue]
    json.units intObj[:units]
    json.scaleFactor intObj[:scaleFactor]
    json.offset intObj[:offset]
    json.meanValue intObj[:meanValue]
    json.standardDeviation intObj[:standardDeviation]
    json.bitsPerValue intObj[:bitsPerValue]
    json.classifiedData do
      cd = intObj[:classedData]
      json.numberOfClasses cd[:numberOfClasses]
      json.classifiedDataItem(cd[:classedDataItems]) do |cdi|
        json.className cdi[:className]
        json.classDescription cdi[:classDescription]
        json.classValue cdi[:classValue]
      end
    end unless intObj[:classedData].empty?
    json.sensorInfo do
      si = intObj[:sensorInfo]
      json.toneGradations si[:toneGradations]
      json.sensorMin si[:sensorMin]
      json.sensorMax si[:sensorMax]
      json.sensorUnits si[:sensorUnits]
      json.sensorPeakResponse si[:sensorPeakResponse]
    end unless intObj[:sensorInfo].empty?
  end
end