Sha256: ae14841fd57e2d19b4db66079d06d2b084ab07bad9787b34ae2c10457cce72aa

Contents?: true

Size: 1.24 KB

Versions: 57

Compression:

Stored size: 1.24 KB

Contents

# unpack browse category
# Reader - ScienceBase JSON to internal data structure

# History:
#   Stan Smith 2016-06-22 original script

require 'adiwg/mdtranslator/internal/internal_metadata_obj'
require_relative 'module_codelists'

module ADIWG
   module Mdtranslator
      module Readers
         module SbJson

            module BrowseCategory

               def self.unpack(hJson, aResourceTypes, hResponseObj)

                  # instance classes needed in script
                  intMetadataClass = InternalMetadata.new

                  if hJson.has_key?('browseCategories')
                     hJson['browseCategories'].each do |category|
                        hResType = intMetadataClass.newResourceType
                        scope = Codelists.codelist_sb2adiwg('scope_sb2adiwg', category)
                        if scope.nil?
                           hResType[:type] = 'dataset'
                           hResType[:name] = category
                        else
                           hResType[:type] = scope
                        end
                        aResourceTypes << hResType
                     end
                  end

                  return aResourceTypes

               end

            end

         end
      end
   end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.9.1 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.9.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.8.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.7.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.6.1 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.6.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.5.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.4.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.5 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.4 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.3 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.2 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.1 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.3.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.2.0 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.1.2 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb
adiwg-mdtranslator-2.1.1 lib/adiwg/mdtranslator/readers/sbJson/modules/module_browseCategory.rb