Sha256: a99dc92ba3ea9958a68000abf45784c936af59a5c6056a7ad3fba4753ab90554

Contents?: true

Size: 880 Bytes

Versions: 58

Compression:

Stored size: 880 Bytes

Contents

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

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.5 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.4 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.3 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.9.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.8.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.7.2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.7.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.7.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.6.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.0.0.pre.rc1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.0.0.pre.beta3 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.5.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.5.0 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.0.0.pre.beta2 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.4.1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-3.0.0.pre.beta1 lib/hyrax/resource_sync/source_description_writer.rb
hyrax-2.4.0 lib/hyrax/resource_sync/source_description_writer.rb