Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Attribute

Returns a new instance of Html_Attribute.



17
18
19
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb', line 17

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hAttribute) ⇒ Object



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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb', line 21

def writeHtml(hAttribute)
   # classes used
   identifierClass = Html_Identifier.new(@html)
   rangeElementDescriptionClass = Html_RangeElementDescription.new(@html)

   # attribute - sequence identifier
   unless hAttribute[:sequenceIdentifier].nil?
      @html.em('Sequence Identifier: ')
      @html.text!(hAttribute[:sequenceIdentifier])
      @html.br
   end

   # attribute - sequence identifier type
   unless hAttribute[:sequenceIdentifierType].nil?
      @html.em('Sequence Identifier Type: ')
      @html.text!(hAttribute[:sequenceIdentifierType])
      @html.br
   end

   # attribute - attribute description
   unless hAttribute[:attributeDescription].nil?
      @html.em('Attribute Description:')
      @html.div(:class => 'block') do
         @html.text!(hAttribute[:attributeDescription])
      end
   end

   # attribute - attribute identifiers [] {identifier}
   hAttribute[:attributeIdentifiers].each do |hIdentifier|
      @html.div do
         @html.div('Identifier', 'class' => 'h5')
         @html.div(:class => 'block') do
            identifierClass.writeHtml(hIdentifier)
         end
      end
   end

   # attribute - minimum value
   unless hAttribute[:minValue].nil?
      @html.em('Minimum Value: ')
      @html.text!(hAttribute[:minValue].to_s)
      @html.br
   end

   # attribute - maximum value
   unless hAttribute[:maxValue].nil?
      @html.em('Maximum Value: ')
      @html.text!(hAttribute[:maxValue].to_s)
      @html.br
   end

   # attribute - units
   unless hAttribute[:units].nil?
      @html.em('Units: ')
      @html.text!(hAttribute[:units])
      @html.br
   end

   # attribute - scale factor
   unless hAttribute[:scaleFactor].nil?
      @html.em('Scale Factor: ')
      @html.text!(hAttribute[:scaleFactor].to_s)
      @html.br
   end

   # attribute - offset
   unless hAttribute[:offset].nil?
      @html.em('Offset: ')
      @html.text!(hAttribute[:offset].to_s)
      @html.br
   end

   # attribute - mean value
   unless hAttribute[:meanValue].nil?
      @html.em('Mean Value: ')
      @html.text!(hAttribute[:meanValue].to_s)
      @html.br
   end

   # attribute - number of values
   unless hAttribute[:numberOfValues].nil?
      @html.em('Number of Values: ')
      @html.text!(hAttribute[:numberOfValues].to_s)
      @html.br
   end

   # attribute - standard deviation
   unless hAttribute[:standardDeviation].nil?
      @html.em('Standard Deviation: ')
      @html.text!(hAttribute[:standardDeviation].to_s)
      @html.br
   end

   # attribute - bits per value
   unless hAttribute[:bitsPerValue].nil?
      @html.em('Bits Per Value: ')
      @html.text!(hAttribute[:bitsPerValue].to_s)
      @html.br
   end

   # attribute - range element description
   hAttribute[:rangeElementDescription].each do |red|
      @html.div do
         @html.div('Range Element Description', 'class' => 'h5')
         @html.div(:class => 'block') do
            rangeElementDescriptionClass.writeHtml(red)
         end
      end
   end

   # attribute - bound minimum
   unless hAttribute[:boundMinimum].nil?
      @html.em('Bound Minimum: ')
      @html.text!(hAttribute[:boundMinimum].to_s)
      @html.br
   end

   # attribute - bound maximum
   unless hAttribute[:boundMaximum].nil?
      @html.em('Bound Maximum: ')
      @html.text!(hAttribute[:boundMaximum].to_s)
      @html.br
   end

   # attribute - peak response
   unless hAttribute[:peakResponse].nil?
      @html.em('Peak Response: ')
      @html.text!(hAttribute[:peakResponse].to_s)
      @html.br
   end

   # attribute - tone gradations
   unless hAttribute[:toneGradations].nil?
      @html.em('Tone Gradations: ')
      @html.text!(hAttribute[:toneGradations].to_s)
      @html.br
   end

   # attribute - band boundary definitions
   unless hAttribute[:bandBoundaryDefinition].nil?
      @html.em('Band Boundary Definition:')
      @html.div(:class => 'block') do
         @html.text!(hAttribute[:bandBoundaryDefinition])
      end
   end

   # attribute - nominal spatial resolution
   unless hAttribute[:nominalSpatialResolution].nil?
      @html.em('Nominal Spatial Resolution: ')
      @html.text!(hAttribute[:nominalSpatialResolution].to_s)
      @html.br
   end

   # attribute - transfer function type
   unless hAttribute[:transferFunctionType].nil?
      @html.em('Transfer Function Type: ')
      @html.text!(hAttribute[:transferFunctionType])
      @html.br
   end

   # attribute - transmitted polarization
   unless hAttribute[:transmittedPolarization].nil?
      @html.em('Transmitted Polarization: ')
      @html.text!(hAttribute[:transmittedPolarization])
      @html.br
   end

   # attribute - detected polarization
   unless hAttribute[:detectedPolarization].nil?
      @html.em('Detected Polarization: ')
      @html.text!(hAttribute[:detectedPolarization])
      @html.br
   end

end