lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb in adiwg-mdtranslator-1.2.1 vs lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb in adiwg-mdtranslator-1.3.0
- old
+ new
@@ -1,14 +1,15 @@
# HTML writer
# data dictionary
# History:
# Stan Smith 2015-03-26 original script
+# Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
-require 'html_citation'
-require 'html_domain'
-require 'html_entity'
+require_relative 'html_citation'
+require_relative 'html_domain'
+require_relative 'html_entity'
module ADIWG
module Mdtranslator
module Writers
module Html
@@ -19,13 +20,13 @@
end
def writeHtml(hDictionary)
# classes used
- htmlCitation = $HtmlNS::MdHtmlCitation.new(@html)
- htmlDomain = $HtmlNS::MdHtmlDictionaryDomain.new(@html)
- htmlEntity = $HtmlNS::MdHtmlDictionaryEntity.new(@html)
+ htmlCitation = MdHtmlCitation.new(@html)
+ htmlDomain = MdHtmlDictionaryDomain.new(@html)
+ htmlEntity = MdHtmlDictionaryEntity.new(@html)
hDictId = hDictionary[:dictionaryInfo]
aDictDom = hDictionary[:domains]
aDictEnt = hDictionary[:entities]
@@ -65,13 +66,13 @@
end
end
# data dictionary - resource domains
- @html.details do
- @html.summary('Resource Domains', {'class'=>'h4'})
- if !aDictDom.empty?
+ unless aDictDom.empty?
+ @html.details do
+ @html.summary('Resource Domains', {'class'=>'h4'})
aDictDom.each do |hDomain|
@html.section(:class=>'block') do
@html.details do
@html.summary(hDomain[:domainCode], {'class'=>'h5'})
@html.section(:class=>'block') do
@@ -82,12 +83,12 @@
end
end
end
# data dictionary - resource schema
- @html.details do
- @html.summary('Resource Entities', {'class'=>'h4'})
- if !aDictEnt.empty?
+ unless aDictEnt.empty?
+ @html.details do
+ @html.summary('Resource Entities', {'class'=>'h4'})
aDictEnt.each do |hEntity|
@html.section(:class=>'block') do
@html.details do
@html.summary(hEntity[:entityCode], {'class'=>'h5'})
@html.section(:class=>'block') do