Class: Ddr::Structures::Fptr
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ddr::Structures::Fptr
- Defined in:
- lib/ddr/structures/fptr.rb
Overview
Wraps a Nokogiri (XML) ‘fptr’ node
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(args) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/ddr/structures/fptr.rb', line 23 def self.build(args) node = Nokogiri::XML::Node.new('fptr', args[:document]) node['ID'] = args[:id] if args[:id] node['FILEID'] = args[:fileid] if args[:fileid] node end |
Instance Method Details
#dereferenced_hash ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ddr/structures/fptr.rb', line 15 def dereferenced_hash structure = Ddr::Structure.new(document) file = File.find(structure, fileid) repo_id = file.repo_ids.first use = file.flocats.first.effective_use { id: id, repo_id: repo_id, use: use }.compact end |
#fileid ⇒ Object
11 12 13 |
# File 'lib/ddr/structures/fptr.rb', line 11 def fileid self['FILEID'] end |
#id ⇒ Object
7 8 9 |
# File 'lib/ddr/structures/fptr.rb', line 7 def id self['ID'] end |