Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_TemporalExtent

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_TemporalExtent

Returns a new instance of Html_TemporalExtent.



21
22
23
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_temporalExtent.rb', line 21

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hExtent) ⇒ Object



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

def writeHtml(hExtent)

   # classes used
   periodClass = Html_TimePeriod.new(@html)
   instantClass = Html_TimeInstant.new(@html)

   # temporal element - time instant {timeInstant}
   unless hExtent[:timeInstant].empty?
      hInstant = hExtent[:timeInstant][:timeInstant]
      hGeoAge = hExtent[:timeInstant][:geologicAge]
      unless hInstant.empty?
         @html.h5('Time Instant')
      end
      unless hGeoAge.empty?
         @html.h5('Geologic Age')
      end
      instantClass.writeHtml(hExtent[:timeInstant])
   end

   # temporal element - time period {timePeriod}
   unless hExtent[:timePeriod].empty?
      hStartDate = hExtent[:timePeriod][:startDateTime]
      hEndDate = hExtent[:timePeriod][:endDateTime]
      hStartAge = hExtent[:timePeriod][:startGeologicAge]
      hEndAge = hExtent[:timePeriod][:endGeologicAge]
      unless hStartDate.empty? && hEndDate.empty?
         @html.h5('Time Period')
      end
      unless hStartAge.empty? && hEndAge.empty?
         @html.h5('Geologic Period')
      end
      periodClass.writeHtml(hExtent[:timePeriod])
   end

end