Sha256: e461d119a33d8cce8f02a2e8649d2bbd478c51f47176153f0fc80ebef808b787

Contents?: true

Size: 1.37 KB

Versions: 58

Compression:

Stored size: 1.37 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'
                        hResource[:status].each do |status|
                           sbStatus = Codelists.codelist_adiwg2sb('progress_adiwg2sb', status)
                           unless sbStatus.nil?
                              hProject[:projectStatus] = sbStatus
                              break
                           end
                        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

58 entries across 58 versions & 1 rubygems

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