Sha256: 2901d609f41248068ed932b7e18cbfc1f4f3305789431210ec0094ccdcc363c6

Contents?: true

Size: 1.66 KB

Versions: 35

Compression:

Stored size: 1.66 KB

Contents

# mdJson 2.0 writer - dictionary

# History:
#  Stan Smith 2017-11-09 add data dictionary description
#  Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0
#  Josh Bradley original script

require 'jbuilder'
require_relative 'mdJson_citation'
require_relative 'mdJson_responsibleParty'
require_relative 'mdJson_locale'
require_relative 'mdJson_domain'
require_relative 'mdJson_entity'

module ADIWG
   module Mdtranslator
      module Writers
         module MdJson

            module Dictionary

               @Namespace = ADIWG::Mdtranslator::Writers::MdJson

               def self.build(hDictionary)

                  Jbuilder.new do |json|
                     json.citation Citation.build(hDictionary[:citation]) unless hDictionary[:citation].empty?
                     json.description hDictionary[:description]
                     json.subject hDictionary[:subjects] unless hDictionary[:subjects].empty?
                     json.recommendedUse hDictionary[:recommendedUses] unless hDictionary[:recommendedUses].empty?
                     json.locale @Namespace.json_map(hDictionary[:locales], Locale)
                     json.responsibleParty ResponsibleParty.build(hDictionary[:responsibleParty])
                     json.dictionaryFunctionalLanguage hDictionary[:dictionaryFunctionalLanguage]
                     json.dictionaryIncludedWithResource hDictionary[:includedWithDataset]
                     json.domain @Namespace.json_map(hDictionary[:domains], Domain)
                     json.entity @Namespace.json_map(hDictionary[:entities], Entity)
                  end

               end # build
            end # Dictionary

         end
      end
   end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb