Sha256: 60ef3c5a8e0c2b740a7ccf802821332705b47c90e95a695551dbc20cfe211065

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

# sbJson 1.0 writer metadata repository

# History:
#  Stan Smith 2017-06-06 original script

module ADIWG
   module Mdtranslator
      module Writers
         module SbJson

            module Repository

               def self.build(aRepositories)

                  repository = {}

                  aRepositories.each do |hRepo|
                     if hRepo[:repository] == 'data.gov'
                        repository[:repository] = hRepo[:repository]
                        repository[:title] = 'Data.gov' # default
                        unless hRepo[:citation].empty?
                           repository[:title] = hRepo[:citation][:title] unless hRepo[:citation][:title].nil?
                           unless hRepo[:citation][:identifiers].empty?
                              repository[:identifier] = hRepo[:citation][:identifiers][0][:identifier]
                           end
                        end
                        repository[:metadataStandard] = hRepo[:metadataStandard]
                        break
                     end
                  end

                  if repository.empty?
                     return nil
                  end

                  repository

               end

            end

         end
      end
   end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.0.0 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_metadataRepository.rb
adiwg-mdtranslator-2.0.0rc13 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_metadataRepository.rb
adiwg-mdtranslator-2.0.0rc11 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_metadataRepository.rb