Sha256: dd23248a09e61cc36f68aabce6cf98bc6591d24b0bc7243a03857dd1e8866d67

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

# sbJson 1.0 writer project

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

require_relative 'sbJson_codelists'

module ADIWG
   module Mdtranslator
      module Writers
         module SbJson

            module Project

               def self.build(hResource)

                  hProject = {}

                  hResource[:resourceTypes].each do |hResourceType|
                     if hResourceType[:type] == 'project'
                        hProject[:className] = 'gov.sciencebase.catalog.item.facet.ProjectFacet'
                        unless hResource[:status].empty?
                           status = hResource[:status][0]
                           sbStatus = Codelists.codelist_iso_to_sb('iso_sb_progress', :isoCode => status)
                           hProject[:projectStatus] = sbStatus
                        end
                        unless hResource[:shortAbstract].nil?
                           hProject[:parts] = [
                              {
                                 type: 'Short Project Description',
                                 value: hResource[:shortAbstract]
                              }
                           ]
                        end
                     end
                  end

                  hProject

               end

            end

         end
      end
   end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_project.rb