Class: ADIWG::Mdtranslator::Writers::Html::Html_Scope

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_Scope

Returns a new instance of Html_Scope.



17
18
19
# File 'lib/adiwg/mdtranslator/writers/html/sections/html_scope.rb', line 17

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hScope) ⇒ Object



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
58
59
60
61
62
# File 'lib/adiwg/mdtranslator/writers/html/sections/html_scope.rb', line 21

def writeHtml(hScope)

   # classes used
   descriptionClass = Html_ScopeDescription.new(@html)
   extentClass = Html_Extent.new(@html)

   # scope - code
   unless hScope[:scopeCode].nil?
      @html.em('Scope Code: ')
      @html.text!(hScope[:scopeCode])
      @html.br
   end

   # scope - description [] {scopeDescription}
   unless !hScope.key?(:scopeDescriptions)
      unless hScope[:scopeDescriptions].empty?
         hScope[:scopeDescriptions].each do |hDescription|
            @html.details do
               @html.summary('Description', {'class' => 'h5'})
               @html.section(:class => 'block') do
                  descriptionClass.writeHtml(hDescription)
               end
            end
         end
      end
   end

   # scope - extent [] {extent}
   unless !hScope.key?(:extents)
      unless hScope[:extents].empty?
         hScope[:extents].each do |hExtent|
            @html.details do
               @html.summary('Extent', {'class' => 'h5'})
               @html.section(:class => 'block') do
                  extentClass.writeHtml(hExtent)
               end
            end
         end
      end
   end

end