Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_TimeInstant

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_TimeInstant

Returns a new instance of Html_TimeInstant.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hInstant) ⇒ 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_timeInstant.rb', line 25

def writeHtml(hInstant)

   # classes used
   identifierClass = Html_Identifier.new(@html)
   datetimeClass = Html_Datetime.new(@html)
   geoAgeClass = Html_GeologicAge.new(@html)

   # time instant - id
   unless hInstant[:timeId].nil?
      @html.em('Instant ID: ')
      @html.text!(hInstant[:timeId])
      @html.br
   end

   # time instant - instant name []
   hInstant[:instantNames].each do |iName|
      @html.em('Instant Name: ')
      @html.text!(iName)
      @html.br
   end

   # time instant - dateTime
   unless hInstant[:timeInstant].empty?
      @html.em('DateTime: ')
      @html.text!(datetimeClass.writeHtml(hInstant[:timeInstant]))
      @html.br
   end

   # time instant - description
   unless hInstant[:description].nil?
      @html.em('Description: ')
      @html.div(:class => 'block') do
         @html.text!(hInstant[:description])
      end
   end

   # time instant - geologic age
   unless hInstant[:geologicAge].empty?
      geoAgeClass.writeHtml(hInstant[:geologicAge])
   end

   # time instant - identifier {identifier}
   unless hInstant[:identifier].empty?
      @html.div do
         @html.div('Identifier', 'class' => 'h5')
         @html.div(:class => 'block') do
            identifierClass.writeHtml(hInstant[:identifier])
         end
      end
   end

end