Class: UWDC::StructMap

Inherits:
Mets
  • Object
show all
Defined in:
lib/uwdc/struct_map.rb

Overview

Return the structure of a METS file

Instance Attribute Summary

Attributes inherited from Mets

#id, #xml

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

#nodesObject



4
5
6
# File 'lib/uwdc/struct_map.rb', line 4

def nodes
  @xml.nodes.xpath("//structMap[contains(@ID,'#{@id}')]")
end

#structureObject



8
9
10
# File 'lib/uwdc/struct_map.rb', line 8

def structure
  nodes.xpath('div').inject([]){|result, div| result << Div.new(div)}
end