Class: Exlibris::Aleph::Holding::Metadata

Inherits:
Metadata
  • Object
show all
Defined in:
lib/exlibris/aleph/holding/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Metadata

#marc_record

Constructor Details

#initialize(marc_xml) ⇒ Metadata

Returns a new instance of Metadata.



8
9
10
11
12
# File 'lib/exlibris/aleph/holding/metadata.rb', line 8

def initialize(marc_xml)
  marc_xml.gsub!('<holding>', '<record>')
  marc_xml.gsub!('</holding>', '</record>')
  @marc_xml = marc_xml.strip
end

Instance Attribute Details

#marc_xmlObject (readonly)

Returns the value of attribute marc_xml.



6
7
8
# File 'lib/exlibris/aleph/holding/metadata.rb', line 6

def marc_xml
  @marc_xml
end

Instance Method Details

#locationObject



22
23
24
# File 'lib/exlibris/aleph/holding/metadata.rb', line 22

def location
  @location ||= marc_record['852'] unless marc_record.nil?
end

#shelving_locationObject



18
19
20
# File 'lib/exlibris/aleph/holding/metadata.rb', line 18

def shelving_location
  @shelving_location ||= location['c'] unless location.nil?
end

#sub_locationObject



14
15
16
# File 'lib/exlibris/aleph/holding/metadata.rb', line 14

def sub_location
  @sub_location ||= location['b'] unless location.nil?
end