Sha256: 5eb7b5e9bf992ab701f13a063dca56cde355d6c5bfc5297b629547c0e009a157

Contents?: true

Size: 615 Bytes

Versions: 1

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true

module TrajectPlus
  module Macros
    # Macros for extracting MODS values from Nokogiri documents
    module Mods
      NS = { mods: 'http://www.loc.gov/mods/v3',
             rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
             dc: 'http://purl.org/dc/elements/1.1/',
             xlink: 'http://www.w3.org/1999/xlink' }.freeze

      def self.extended(mod)
        mod.extended Traject::Macros::NokogiriMacros
      end

      # @param xpath [String] the xpath query expression
      def extract_mods(xpath)
        extract_xpath(xpath, NS)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
traject_plus-1.2.0 lib/traject_plus/macros/mods.rb