Class: DiscoveryIndexer::InputXml::Purlxml
- Inherits:
-
Object
- Object
- DiscoveryIndexer::InputXml::Purlxml
- Defined in:
- lib/reader/purlxml.rb
Overview
This class is the main class to access and parse the purl xml
as retrieved from PURL server
Instance Method Summary collapse
-
#initialize(druid) ⇒ Purlxml
constructor
initializes a new object.
-
#load ⇒ PurlxmlModel
loads the purl xml to purlxml model for the fedora object defind in the druid, it reads the purl xml once from PURL server, and repeat the parsing with each call.
-
#reload ⇒ PurlxmlModel
loads the purl xml to purlxml model for the fedora object defind in the druid it reads the purl xml from PURL server with every call.
Constructor Details
#initialize(druid) ⇒ Purlxml
initializes a new object
12 13 14 15 |
# File 'lib/reader/purlxml.rb', line 12 def initialize(druid) @druid = druid @purlxml_ng_doc = nil end |
Instance Method Details
#load ⇒ PurlxmlModel
loads the purl xml to purlxml model for the fedora object defind in the druid, it reads the purl xml once from PURL server, and repeat the parsing with each call
20 21 22 23 24 25 |
# File 'lib/reader/purlxml.rb', line 20 def load @purlxml_ng_doc = PurlxmlReader.read(@druid) if @purlxml_ng_doc.nil? purlxml_parser = PurlxmlParserStrict.new(@druid, @purlxml_ng_doc) purlxml_model = purlxml_parser.parse purlxml_model end |
#reload ⇒ PurlxmlModel
loads the purl xml to purlxml model for the fedora object defind in the druid it reads the purl xml from PURL server with every call
30 31 32 33 |
# File 'lib/reader/purlxml.rb', line 30 def reload @purlxml_ng_doc = PurlxmlReader.read(@druid) load end |