class Exlibris::Aleph::Holding

Attributes

id[R]
record_id[R]

Public Class Methods

new(record_id, id) click to toggle source
# File lib/exlibris/aleph/holding.rb, line 5
def initialize(record_id, id)
  @record_id = record_id
  @id = id
end

Public Instance Methods

collection() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 10
def collection
  unless client.error?
    @collection ||= collections[admin_library].find do |collection|
      collection.code == collection_code &&
        collection.sub_library == sub_library
    end
  end
end
metadata() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 19
def metadata
  @metadata ||= Metadata.new(client.to_xml) unless client.error?
end

Private Instance Methods

admin_library() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 28
def admin_library
  @admin_library ||= sub_library.admin_library
end
client() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 24
def client
  @client ||= API::Client::Record::Holding.new(record_id, id)
end
collection_code() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 54
def collection_code
  @collection_code ||= metadata.shelving_location
end
collections() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 42
def collections
  @collections ||= tables_manager.collections
end
sub_libraries() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 38
def sub_libraries
  @sub_libraries ||= tables_manager.sub_libraries
end
sub_library() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 32
def sub_library
  @sub_library ||= sub_libraries.find do |sub_library|
    sub_library.code == sub_library_code
  end
end
sub_library_code() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 50
def sub_library_code
  @sub_library_code ||= metadata.sub_location
end
tables_manager() click to toggle source
# File lib/exlibris/aleph/holding.rb, line 46
def tables_manager
  @tables_manager ||= TablesManager.instance
end