module Metacrunch::Marcxml

Constants

VERSION

Public Class Methods

[](xml) click to toggle source

Convenience method for Metacrunch::Marcxml.parse(xml, collection_mode: false)

@see Metacrunch::Marcxml#parse

# File lib/metacrunch/marcxml.rb, line 43
def [](xml)
  self.parse(xml, collection_mode: false)
end
parse(xml, collection_mode: false) click to toggle source

Parses a MARCXML string into a {Metacrunch::Marcxml::Document}.

@param xml [String] the MARCXML document as a string @param collection_mode [true, false] set to `true` if the MARCXML contains more than one record.

Default is `false`.

@return [Metacrunch::Marcxml::Document, Array<Metacrunch::Marcxml::Document>, nil] the parsed

{Metacrunch::Marcxml::Document}, an array of documents if `collection_mode` was `true`
or `nil` if the MARCXML did not contain valid data.
# File lib/metacrunch/marcxml.rb, line 34
def parse(xml, collection_mode: false)
  Parser.new.parse(xml, collection_mode: collection_mode)
end