Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_Releasability

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Releasability

Returns a new instance of Html_Releasability.



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

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hRelease) ⇒ Object



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

def writeHtml(hRelease)

   # classes used
   responsibilityClass = Html_Responsibility.new(@html)

   # releasability - dissemination constraint {restrictionCode}
   hRelease[:disseminationConstraint].each do |restriction|
      @html.em('Dissemination Constraint Code: ')
      @html.text!(restriction)
      @html.br
   end

   # releasability - statement
   unless hRelease[:statement].nil?
      @html.em('Statement: ')
      @html.div(:class => 'block') do
         @html.text!(hRelease[:statement])
      end
   end

   # releasability - addressee [] {responsibility}
   unless hRelease[:addressee].empty?
      @html.div do
         @html.div('Applies to', {'class' => 'h5'})
         @html.div(:class => 'block') do
            hRelease[:addressee].each do |hAddressee|
               @html.div do
                  @html.div(hAddressee[:roleName], 'class' => 'h5')
                  @html.div(:class => 'block') do
                     responsibilityClass.writeHtml(hAddressee)
                  end
               end
            end
         end
      end
   end

end