Sha256: 35839899f6a4f64ecc8e5c6051193c9fe8ea8bab6dfc69d96e926d1ed15a98d0
Contents?: true
Size: 976 Bytes
Versions: 20
Compression:
Stored size: 976 Bytes
Contents
module Ddr::Models::Structures # # Wraps a Nokogiri (XML) 'FLocat' node # class FLocat < SimpleDelegator def id self['ID'] end def loctype self['LOCTYPE'] end def otherloctype self['OTHERLOCTYPE'] end def use self['USE'] end def href self['xlink:href'] end def ark? loctype == 'ARK' end def ark href if ark? end def effective_use use ? use : File.new(parent).effective_use end def repo_id SolrDocument.find_by_permanent_id(ark).id if ark? end def self.build(args) node = Nokogiri::XML::Node.new('FLocat', args[:document]) node['ID'] = args[:id] if args[:id] node['LOCTYPE'] = args[:loctype] if args[:loctype] node['OTHERLOCTYPE'] = args[:otherloctype] if args[:otherloctype] node['USE'] = args[:use] if args[:use] node['xlink:href'] = args[:href] if args[:href] node end end end
Version data entries
20 entries across 20 versions & 1 rubygems