Sha256: 157f9909adbc72a821836e0a2170774da7bba9096cbeaa46adf4bccf84b9ad69

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

# sbJson 1.0 writer

# History:
#  Stan Smith 2017-05-23 original script

module ADIWG
   module Mdtranslator
      module Writers
         module SbJson

            module Provenance

               def self.build(hMetadataInfo)

                  aContacts = hMetadataInfo[:metadataContacts]
                  aDates = hMetadataInfo[:metadataDates]

                  hProvenance = {}
                  hProvenance[:dataSource] = 'generated using ADIwg mdTranslator ' + ADIWG::Mdtranslator::VERSION

                  aDates.each do |hDate|
                     if hDate[:dateType] == 'creation'
                        hProvenance[:dateCreated] = AdiwgDateTimeFun.stringFromDateObject(hDate)
                     end
                     if hDate[:dateType] == 'lastUpdate'
                        hProvenance[:lastUpdated] = AdiwgDateTimeFun.stringFromDateObject(hDate)
                     end
                  end

                  if hProvenance.empty?
                     return nil
                  end

                  hProvenance

               end

            end

         end
      end
   end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.0.0rc11 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb
adiwg-mdtranslator-2.0.0rc10 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_provenance.rb