Sha256: 6a1df342954940a4db69bd0bb084c12d241277ceacb86dd561e4c33e52994957

Contents?: true

Size: 1.52 KB

Versions: 24

Compression:

Stored size: 1.52 KB

Contents

# mdJson 2.0 writer - dictionary

# History:
#   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.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.dictionaryFormat hDictionary[:dictionaryFormat]
                     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

24 entries across 24 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.5 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.4 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.3 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.3.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.2.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.1.2 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.1.1 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.1.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc13 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc11 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc10 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc8 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc7 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb
adiwg-mdtranslator-2.0.0rc6 lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb