Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_GeologicAge

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_GeologicAge

Returns a new instance of Html_GeologicAge.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hGeoAge) ⇒ Object



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
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_geologicAge.rb', line 20

def writeHtml(hGeoAge)

   # classes used
   citationClass = Html_Citation.new(@html)

   # geologic age - age time scale
   unless hGeoAge[:ageTimeScale].nil?
      @html.em('Age Time Scale: ')
      @html.text!(hGeoAge[:ageTimeScale])
      @html.br
   end

   # geologic age - age estimate
   unless hGeoAge[:ageEstimate].nil?
      @html.em('Age Estimate: ')
      @html.text!(hGeoAge[:ageEstimate])
      @html.br
   end

   # geologic age - age uncertainty
   unless hGeoAge[:ageUncertainty].nil?
      @html.em('Age Uncertainty: ')
      @html.div(:class => 'block') do
         @html.text!(hGeoAge[:ageUncertainty])
      end
   end

   # geologic age - age explanation
   unless hGeoAge[:ageExplanation].nil?
      @html.em('Age Determination Methodology: ')
      @html.div(:class => 'block') do
         @html.text!(hGeoAge[:ageExplanation])
      end
   end

   # geologic age - age references [] {citation}
   hGeoAge[:ageReferences].each do |hCitation|
      @html.div do
         @html.div('Age Reference', {'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hCitation)
         end
      end
   end

end