Class: Mab2::MabXmlAdapter
- Inherits:
-
Object
- Object
- Mab2::MabXmlAdapter
- Defined in:
- lib/mab2/mab_xml_adapter.rb
Instance Attribute Summary collapse
-
#controlfields ⇒ Object
Returns the value of attribute controlfields.
-
#datafields ⇒ Object
Returns the value of attribute datafields.
Instance Method Summary collapse
-
#initialize(xml) ⇒ MabXmlAdapter
constructor
A new instance of MabXmlAdapter.
Constructor Details
#initialize(xml) ⇒ MabXmlAdapter
Returns a new instance of MabXmlAdapter.
7 8 9 10 11 12 |
# File 'lib/mab2/mab_xml_adapter.rb', line 7 def initialize(xml) record = Nokogiri::XML(xml).remove_namespaces!.xpath('//OAI-PMH/ListRecords/record/metadata/record') @controlfields = controlfields_from_mabxml(record) @datafields = datafields_from_mabxml(record) end |
Instance Attribute Details
#controlfields ⇒ Object
Returns the value of attribute controlfields.
5 6 7 |
# File 'lib/mab2/mab_xml_adapter.rb', line 5 def controlfields @controlfields end |
#datafields ⇒ Object
Returns the value of attribute datafields.
5 6 7 |
# File 'lib/mab2/mab_xml_adapter.rb', line 5 def datafields @datafields end |