Sha256: 17493681a95cc345ad0be1bd94a6cc8dc5a62f89937066b589d4cc939fd036de
Contents?: true
Size: 1.34 KB
Versions: 28
Compression:
Stored size: 1.34 KB
Contents
# frozen_string_literal: true module Hyrax module ResourceSync class CapabilityListWriter attr_reader :resource_list_url, :change_list_url, :description_url def initialize(resource_list_url:, change_list_url:, description_url:) @resource_list_url = resource_list_url @change_list_url = change_list_url @description_url = description_url end def write builder.to_xml end # I would like this to be above the builder declaration, but Rubocop can't figure out if it should be indented at the method depth or the private declaration depth # rubocop:disable Metrics/MethodLength 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: description_url) xml['rs'].md(capability: "capabilitylist") xml.url do xml.loc resource_list_url xml['rs'].md(capability: 'resourcelist') end xml.url do xml.loc change_list_url xml['rs'].md(capability: 'changelist') end end end end # rubocop:enable Metrics/MethodLength end end end
Version data entries
28 entries across 28 versions & 1 rubygems