Sha256: 898b40744df69371bb3dbd268511b98928e84f671bfad2263f171659ee675b7c

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

module Exlibris
  module Aleph
    module Table
      module Reader
        class Collections < Base
          FILENAME = 'tab40.eng'

          def initialize(admin_library)
            super(admin_library, FILENAME)
          end

          def all
            rows.map do |row|
              sub_library = sub_libraries.find do |sub_library|
                sub_library.code == row.sub_library_code
              end
              unless sub_library.nil?
                Collection.new(row.code, row.display, sub_library)
              end
            end.compact
          end

          private
          def sub_libraries
            @sub_libraries ||= tables_manager.sub_libraries
          end

          def tables_manager
            @tables_manager ||= Aleph::TablesManager.instance
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 lib/exlibris/aleph/table/reader/collections.rb
exlibris-aleph-2.0.3 lib/exlibris/aleph/table/reader/collections.rb