Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Algorithm

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Algorithm

Returns a new instance of Html_Algorithm.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hAlgorithm) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_algorithm.rb', line 20

def writeHtml(hAlgorithm)

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

   # algorithm - description
   unless hAlgorithm[:description].nil?
      @html.em('Description: ')
      @html.text!(hAlgorithm[:description])
      @html.br
   end

   # algorithm - citation {citation}
   unless hAlgorithm[:citation].empty?
      @html.div do
         @html.div('Algorithm citation', {'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hAlgorithm[:citation])
         end
      end
   end

end