Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Processing

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Processing

Returns a new instance of Html_Processing.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hProcessing) ⇒ Object



22
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_processing.rb', line 22

def writeHtml(hProcessing)

   # classes used
   identifierClass = Html_Identifier.new(@html)
   citationClass = Html_Citation.new(@html)
   algorithmClass = Html_Algorithm.new(@html)

   # processing - procedure description
   unless hProcessing[:procedureDescription].nil?
      @html.em(' Procedure Description: ')
      @html.text!(hProcessing[:procedureDescription])
      @html.br
   end

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

   # processing - software reference {citation}
   unless hProcessing[:softwareReference].empty?
      @html.div do
         @html.div('Software Reference', {'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hProcessing[:softwareReference])
         end
      end
   end

   # processing - runtime parameters
   unless hProcessing[:runtimeParameters].nil?
      @html.em(' Runtime Parameters: ')
      @html.text!(hProcessing[:runtimeParameters])
      @html.br
   end

   # processing - documentation [] {citation}
   hProcessing[:documentation].each do |hCitation|
      @html.div do
         @html.div('Documentation', {'class' => 'h5'})
         @html.div(:class => 'block') do
            citationClass.writeHtml(hCitation)
         end
      end
   end

   # processing - algorithm [] {algorithm}
   hProcessing[:algorithms].each do |hAlgorithm|
      @html.div do
         @html.div('Algorithm', {'class' => 'h5'})
         @html.div(:class => 'block') do
            algorithmClass.writeHtml(hAlgorithm)
         end
      end
   end

end