app/services/external_apis/re3data_service.rb
def parse_repository(repo:, node:)
        return nil unless repo.present? && node.present?

        repo.update(
          description: node.xpath("//r3d:description")&.text,
          url: node.xpath("//r3d:repositoryURL")&.text,
          contact: node.xpath("//r3d:repositoryContact")&.text,
          info: {
            types: node.xpath("//r3d:type").map(&:text),
            subjects: node.xpath("//r3d:subject").map(&:text),
            provider_types: node.xpath("//r3d:providerType").map(&:text),
            keywords: node.xpath("//r3d:keyword").map(&:text),
            access: node.xpath("//r3d:databaseAccess//r3d:databaseAccessType")&.text,
            pid_system: node.xpath("//r3d:pidSystem")&.text,
            policies: node.xpath("//r3d:policy").map { |n| parse_policy(node: n) },
            upload_types: node.xpath("//r3d:dataUpload").map { |n| parse_upload(node: n) }
          }
        )
        repo
      end
# Updates the Repository based on the XML input
# rubocop:disable Metrics/AbcSize
Updates the Repository based on the XML input
rubocop:disable Metrics/AbcSize
Updates the Repository based on the XML input rubocop : disable Metrics / AbcSize
def parse_repository(repo:, node:)
        return nil unless repo.present? && node.present?
        repo.update(
          description: node.xpath("//r3d:description")&.text,
          url: node.xpath("//r3d:repositoryURL")&.text,
          contact: node.xpath("//r3d:repositoryContact")&.text,
          info: {
            types: node.xpath("//r3d:type").map(&:text),
            subjects: node.xpath("//r3d:subject").map(&:text),
            provider_types: node.xpath("//r3d:providerType").map(&:text),
            keywords: node.xpath("//r3d:keyword").map(&:text),
            access: node.xpath("//r3d:databaseAccess//r3d:databaseAccessType")&.text,
            pid_system: node.xpath("//r3d:pidSystem")&.text,
            policies: node.xpath("//r3d:policy").map { |n| parse_policy(node: n) },
            upload_types: node.xpath("//r3d:dataUpload").map { |n| parse_upload(node: n) }
          }
        )
        repo
      end
def parse_repository ( repo : , node : ) return nil unless repo . present? && node . present? repo . update ( description : node . xpath ( "//r3d:description" ) &. text , url : node . xpath ( "//r3d:repositoryURL" ) &. text , contact : node . xpath ( "//r3d:repositoryContact" ) &. text , info : { types : node . xpath ( "//r3d:type" ) . map ( & :text ) , subjects : node . xpath ( "//r3d:subject" ) . map ( & :text ) , provider_types : node . xpath ( "//r3d:providerType" ) . map ( & :text ) , keywords : node . xpath ( "//r3d:keyword" ) . map ( & :text ) , access : node . xpath ( "//r3d:databaseAccess//r3d:databaseAccessType" ) &. text , pid_system : node . xpath ( "//r3d:pidSystem" ) &. text , policies : node . xpath ( "//r3d:policy" ) . map { | n | parse_policy ( node : n ) } , upload_types : node . xpath ( "//r3d:dataUpload" ) . map { | n | parse_upload ( node : n ) } } ) repo end
Updates the Repository based on the XML input
rubocop:disable Metrics/AbcSize
Updates the Repository based on the XML input rubocop : disable Metrics / AbcSize
repo
node