Class: DS::Source::DSMetsXML

Inherits:
BaseSource show all
Defined in:
lib/ds/source/ds_mets_xml.rb

Constant Summary collapse

TYPE =
DS::Constants::DS_METS

Instance Method Summary collapse

Methods inherited from BaseSource

#load_source, #source_type, #to_s

Methods included from SourceCache

#cache, #find_or_open_source, #max_cache_size, #max_cache_size=

Instance Method Details

#open_source(source_file_path) ⇒ Nokogiri::XML::Document

Opens a METS XML file at the given path and returns it as a Nokogiri::XML object.

Namespaces are not removed from the document.

Parameters:

  • source_file_path (String) —

    the path to the source file

Returns:

  • (Nokogiri::XML::Document) —

    the contents of the source file as a Nokogiri::XML object



15
16
17
# File 'lib/ds/source/ds_mets_xml.rb', line 15

def open_source source_file_path
  File.open(source_file_path) { |f| Nokogiri::XML f }
end