Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Format

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Format

Returns a new instance of Html_Format.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hFormat) ⇒ Object



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

def writeHtml(hFormat)

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

   # resource format - format specification {citation}
   unless hFormat[:formatSpecification].empty?
      @html.div do
         @html.div(hFormat[:formatSpecification][:title], {'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hFormat[:formatSpecification])
         end
      end
   end

   # resource format - amendment number
   unless hFormat[:amendmentNumber].nil?
      @html.em('Amendment Number: ')
      @html.text!(hFormat[:amendmentNumber])
      @html.br
   end

   # resource format - compression method
   unless hFormat[:compressionMethod].nil?
      @html.em('Compression Method: ')
      @html.text!(hFormat[:compressionMethod])
      @html.br
   end

   # distribution - technical prerequisite
   unless hFormat[:technicalPrerequisite].nil?
      @html.em('Technical Prerequisite:')
      @html.div(:class => 'block') do
         @html.text!(hFormat[:technicalPrerequisite])
      end
   end

end