Class: UWDC::RelsExt
Overview
Return the CMODELS related to METS file objects
Instance Attribute Summary
Attributes inherited from Mets
Instance Method Summary collapse
Methods inherited from Mets
#display, #dublin_core, #file_sec, #initialize, #mods, #origin, #rels_ext, #struct_map, #to_json, #to_ruby, #to_xml
Constructor Details
This class inherits a constructor from UWDC::Mets
Instance Method Details
#models ⇒ Object
8 9 10 11 12 13 |
# File 'lib/uwdc/rels_ext.rb', line 8 def models nodes.xpath("//amdSec[contains(@ID,'RELS-EXT')]").inject({}) do |result, node| result["#{node.attribute('ID')}"] = pick_attribute(node.xpath(".//hasModel"), 'resource') result end end |
#nodes ⇒ Object
4 5 6 |
# File 'lib/uwdc/rels_ext.rb', line 4 def nodes @xml.nodes.xpath("//amdSec[contains(@ID,'#{@id}')]//RDF[1]") end |