Sha256: bb4cbaf01be3b0877765a8ac7fc7779149ae57c5b34f013a8376a4edf49aa329

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Fahrenheit::AlephUbpb::Adapter::Record
  require_relative "./record/get_items"

  include GetItems
end

=begin
module Fahrenheit::AlephUbpb::Adapter::Items
  require_relative "./items/status_codes"

  def get_records_items(record_ids, document_base = @default_document_base)
    result = super(Fahrenheit::AlephUbpb::Adapter::Items.normalize_record_ids(record_ids), document_base)

    if result.is_a?(Hash)
      result.each do |record_id, items|
        if items.is_a?(Array)
          items.map! do |item|
            item.merge({
              "loanable"            => StatusCodes[item["status_code"]][:loanable],
              "only_short_loanable" => StatusCodes[item["status_code"]][:only_short_loanable],
              "present"             => !item["loanable"] || item["on_shelf"]
            })
          end
        end
      end
    else
      result
    end
  end

  #
  private
  #
  def self.normalize_record_ids(record_ids)
    record_ids.map do |record_id|
      record_id.sub(/^PAD_ALEPH/, "")
    end
  end
end
=end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fahrenheit-aleph_ubpb-0.0.1 lib/fahrenheit/aleph_ubpb/adapter/record.rb