• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 43a887ee-2bf1-4c62-863c-d38ea9e17889

05 Sep 2023 09:19PM UTC coverage: 90.284% (-0.8%) from 91.048%
43a887ee-2bf1-4c62-863c-d38ea9e17889

push

circleci

sandbergja
i2239: Use SRU instead of Alma API for bib record retrieval

8 of 8 new or added lines in 2 files covered. (100.0%)

3429 of 3798 relevant lines covered (90.28%)

330.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/adapters/alma_adapter/marc_response.rb
1
class AlmaAdapter
×
2
  # Responsible for converting an Alma::BibSet to an array of unsuppressed MARC
3
  # records.
4
  class MarcResponse
×
5
    attr_reader :bibs
×
6
    # @param bibs [Alma::BibSet]
7
    def initialize(bibs:)
×
8
      @bibs = bibs
×
9
    end
×
10

11
    def unsuppressed_marc
×
12
      marc_records.reject(&:suppressed?)
×
13
    end
×
14

15
    def all_marc
×
16
      marc_records
×
17
    end
×
18

19
    private
×
20

21
      def marc_records
×
22
        @marc_records ||=
×
23
          MARC::XMLReader.new(bib_marc_xml).to_a.each_with_index.map do |record, idx|
×
24
            AlmaAdapter::MarcRecord.new(bibs[idx], record)
×
25
          end
×
26
      end
×
27

28
      def bib_marc_xml
×
29
        StringIO.new(
×
30
          bibs.flat_map do |bib|
×
31
            bib["anies"]
×
32
          end.join("")
×
33
        )
×
34
      end
×
35
  end
×
36
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc