Class: Krikri::Harvesters::MarcXMLDoc
- Inherits:
-
Object
- Object
- Krikri::Harvesters::MarcXMLDoc
- Defined in:
- lib/krikri/harvesters/marc_xml_harvester.rb
Overview
Value object containing a MARC record’s identifier (parsed from control
field 001) and original (MARC XML) source.
Instance Attribute Summary collapse
- #identifier ⇒ Object readonly
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(nokogiri_doc) ⇒ MarcXMLDoc
constructor
A new instance of MarcXMLDoc.
Constructor Details
#initialize(nokogiri_doc) ⇒ MarcXMLDoc
Returns a new instance of MarcXMLDoc.
87 88 89 90 91 92 |
# File 'lib/krikri/harvesters/marc_xml_harvester.rb', line 87 def initialize(nokogiri_doc) @source = nokogiri_doc.outer_xml doc = Nokogiri::XML(@source) @identifier = doc.xpath("//xmlns:controlfield[@tag='001']").text end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
83 84 85 |
# File 'lib/krikri/harvesters/marc_xml_harvester.rb', line 83 def identifier @identifier end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
83 |
# File 'lib/krikri/harvesters/marc_xml_harvester.rb', line 83 attr_reader :identifier, :source |