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

pulibrary / bibdata / fa8448dd-0600-47e7-8889-1dfa562d11f0

05 Sep 2023 08:01PM UTC coverage: 86.172% (-4.9%) from 91.048%
fa8448dd-0600-47e7-8889-1dfa562d11f0

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%)

3309 of 3840 relevant lines covered (86.17%)

326.63 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