Class: DiscoveryIndexer::InputXml::Modsxml
- Inherits:
-
Object
- Object
- DiscoveryIndexer::InputXml::Modsxml
- Defined in:
- lib/discovery-indexer/reader/modsxml.rb
Overview
This class is the main class to access and parse the mods xml
as retrieved from PURL server
Instance Method Summary collapse
-
#initialize(druid) ⇒ Modsxml
constructor
initializes a new object.
-
#load ⇒ Stanford::Mods::Record
loads the mods xml to stanford mods model for the fedora object defind in the druid, it reads the mods xml once from PURL server, and repeat the parsing with each call.
Constructor Details
#initialize(druid) ⇒ Modsxml
initializes a new object
15 16 17 18 |
# File 'lib/discovery-indexer/reader/modsxml.rb', line 15 def initialize(druid) @druid = druid @modsxml_ng_doc = nil end |
Instance Method Details
#load ⇒ Stanford::Mods::Record
loads the mods xml to stanford mods model for the fedora object defind in the druid, it reads the mods xml once from PURL server, and repeat the parsing with each call
23 24 25 26 27 28 |
# File 'lib/discovery-indexer/reader/modsxml.rb', line 23 def load @modsxml_ng_doc = ModsxmlReader.read(@druid) if @modsxml_ng_doc.nil? modsxml_model = Stanford::Mods::Record.new modsxml_model.from_nk_node(@modsxml_ng_doc) end |