class ADIWG::Mdtranslator::Writers::Html::Html_DataDictionary

Public Class Methods

new(html) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb, line 23
def initialize(html)
   @html = html
end

Public Instance Methods

writeHtml(hDictionary) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb, line 27
def writeHtml(hDictionary)

   # classes used
   citationClass = Html_Citation.new(@html)
   localeClass = Html_Locale.new(@html)
   responsibilityClass = Html_Responsibility.new(@html)
   domainClass = Html_Domain.new(@html)
   entityClass = Html_Entity.new(@html)

   # dictionary -  description
   unless hDictionary[:description].nil?
      @html.em('Dictionary Description:')
      @html.section(:class => 'block') do
         @html.text!(hDictionary[:description])
      end
   end

   # dictionary - subjects []
   hDictionary[:subjects].each do |subject|
      @html.em('Subject: ')
      @html.text!(subject)
      @html.br
   end

   # dictionary - domains [] {domain}
   unless hDictionary[:domains].empty?
      @html.details do
         @html.summary('Domains', {'class' => 'h5'})
         @html.section(:class => 'block') do
            domainClass.writeHtml(hDictionary[:domains])
         end
      end
   end

   # dictionary - entities [] {entity}
   unless hDictionary[:entities].empty?
      @html.details do
         @html.summary('Entities', {'class' => 'h5'})
         @html.section(:class => 'block') do
            entityClass.writeHtml(hDictionary[:entities])
         end
      end
   end

   # dictionary - citation {citation}
   unless hDictionary[:citation].empty?
      @html.details do
         @html.summary('Citation', {'class' => 'h5'})
         @html.section(:class => 'block') do
            citationClass.writeHtml(hDictionary[:citation])
         end
      end
   end

   # dictionary - locales {locale}
   hDictionary[:locales].each do |hLocale|
      @html.details do
         @html.summary('Locale', {'class' => 'h5'})
         @html.section(:class => 'block') do
            localeClass.writeHtml(hLocale)
         end
      end
   end

   # dictionary - responsible party {responsibility}
   unless hDictionary[:responsibleParty].empty?
      @html.details do
         @html.summary(hDictionary[:responsibleParty][:roleName], {'class' => 'h5'})
         @html.section(:class => 'block') do
            responsibilityClass.writeHtml(hDictionary[:responsibleParty])
         end
      end
   end

   # dictionary - recommended uses []
   hDictionary[:recommendedUses].each do |use|
      @html.em('Recommended Use: ')
      @html.text!(use)
      @html.br
   end

   # dictionary - dictionary functional language
   unless hDictionary[:dictionaryFunctionalLanguage].nil?
      @html.em('Dictionary Functional Language: ')
      @html.text!(hDictionary[:dictionaryFunctionalLanguage])
      @html.br
   end

   # dictionary - included with dataset {Boolean}
   @html.em('Dictionary Included with Dataset?: ')
   @html.text!(hDictionary[:includedWithDataset].to_s)
   @html.br

end