Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Identifier

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Identifier



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hIdentifier) ⇒ Object



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

def writeHtml(hIdentifier)

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

   # identifier - identifier
   unless hIdentifier[:identifier].nil?
      @html.em('Identifier:')
      @html.text!(hIdentifier[:identifier])
      @html.br
   end

   # identifier - namespace
   unless hIdentifier[:namespace].nil?
      @html.em(' Namespace:')
      @html.text!(hIdentifier[:namespace])
      @html.br
   end

   # identifier - version
   unless hIdentifier[:version].nil?
      @html.em(' Version:')
      @html.text!(hIdentifier[:version])
      @html.br
   end

   # identifier - name (only in spatial reference system projection)
   unless hIdentifier[:name].nil?
      @html.em(' Name:')
      @html.text!(hIdentifier[:name])
      @html.br
   end

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

   # identifier - authority {citation}
   unless hIdentifier[:citation].empty?
      @html.div do
         @html.div('Authority', {'id' => 'metadata-identifier', 'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hIdentifier[:citation])
         end
      end
   end

end