Class: Ddr::Structures::FLocat
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Ddr::Structures::FLocat
- Defined in:
- lib/ddr/structures/f_locat.rb
Overview
Wraps a Nokogiri (XML) ‘FLocat’ node
Class Method Summary collapse
Instance Method Summary collapse
- #ark ⇒ Object
- #ark? ⇒ Boolean
- #effective_use ⇒ Object
- #href ⇒ Object
- #id ⇒ Object
- #loctype ⇒ Object
- #otherloctype ⇒ Object
- #repo_id ⇒ Object
- #use ⇒ Object
Class Method Details
.build(args) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/ddr/structures/f_locat.rb', line 43 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 |
Instance Method Details
#ark ⇒ Object
31 32 33 |
# File 'lib/ddr/structures/f_locat.rb', line 31 def ark href if ark? end |
#ark? ⇒ Boolean
27 28 29 |
# File 'lib/ddr/structures/f_locat.rb', line 27 def ark? loctype == 'ARK' end |
#effective_use ⇒ Object
35 36 37 |
# File 'lib/ddr/structures/f_locat.rb', line 35 def effective_use use ? use : File.new(parent).effective_use end |
#href ⇒ Object
23 24 25 |
# File 'lib/ddr/structures/f_locat.rb', line 23 def href self['xlink:href'] end |
#id ⇒ Object
7 8 9 |
# File 'lib/ddr/structures/f_locat.rb', line 7 def id self['ID'] end |
#loctype ⇒ Object
11 12 13 |
# File 'lib/ddr/structures/f_locat.rb', line 11 def loctype self['LOCTYPE'] end |
#otherloctype ⇒ Object
15 16 17 |
# File 'lib/ddr/structures/f_locat.rb', line 15 def otherloctype self['OTHERLOCTYPE'] end |
#repo_id ⇒ Object
39 40 41 |
# File 'lib/ddr/structures/f_locat.rb', line 39 def repo_id SolrDocument.find_by_permanent_id(ark).id if ark? end |
#use ⇒ Object
19 20 21 |
# File 'lib/ddr/structures/f_locat.rb', line 19 def use self['USE'] end |