Sha256: ba71f1354c1d50b3f1c3d33dc388cd81db1fe97d226bf570f5366234bf664cd4

Contents?: true

Size: 884 Bytes

Versions: 29

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module ResourceSync
    class SourceDescriptionWriter
      attr_reader :capability_list_url
      def initialize(capability_list_url: 'http://example.com/dataset1/capabilitylist.xml')
        @capability_list_url = capability_list_url
      end

      def write
        builder.to_xml
      end

      private

      def builder
        Nokogiri::XML::Builder.new do |xml|
          xml.urlset('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9',
                     'xmlns:rs' => 'http://www.openarchives.org/rs/terms/') do
            xml['rs'].ln(rel: "up", href: capability_list_url)
            xml['rs'].md(capability: "description")
            xml.url do
              xml.loc capability_list_url
              xml['rs'].md(capability: 'capabilitylist')
            end
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.4 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.3 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.0.rc3 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.0.rc2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-5.0.0.rc1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.6.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0.rc3 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0.rc2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0.rc1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.5.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0.beta2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.4.2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-4.0.0.beta1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.4.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.4.0 lib/hyrax/resource_sync/source_description_writer.rb