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

pulibrary / bibdata / 373ad6ff-fad2-405a-ab26-3d30fb5ceecf

24 Dec 2024 08:24PM UTC coverage: 91.938% (+0.08%) from 91.859%
373ad6ff-fad2-405a-ab26-3d30fb5ceecf

Pull #2563

circleci

maxkadel
Put attaching xml files in their own batch
Pull Request #2563: I2321 Shift SCSB full index tasks into separate background jobs

152 of 156 new or added lines in 10 files covered. (97.44%)

65 existing lines in 17 files now uncovered.

3478 of 3783 relevant lines covered (91.94%)

366.14 hits per line

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

95.24
/app/adapters/alma_adapter/status.rb
1
# Abstraction responsible for calculating the status and status label of a given
2
# holding.
3
# @TODO Add support for all the statuses in
4
#   https://github.com/pulibrary/marc_liberation/issues/937
5
class AlmaAdapter::Status
1✔
6
  attr_reader :bib, :holding, :aeon
1✔
7
  # @param bib [Alma::Bib]
8
  # @param holding [Hash] Holding data pulled from Alma::AvailabilityResponse
9
  # @param aeon [Bool] Is Aeon location?
10
  def initialize(bib:, holding:, aeon: false)
1✔
11
    @bib = bib
10✔
12
    @holding = holding
10✔
13
    @aeon = aeon
10✔
14
  end
15

16
  def to_s
1✔
17
    return "On-site Access" if on_site_holding?
10✔
18
    return "Some items not available" if holding["availability"] == "check_holdings"
7✔
19
    return holding["availability"].titlecase if holding["availability"]
6✔
20

21
    # For electronic holdings
UNCOV
22
    return holding["activation_status"].titlecase if holding["activation_status"]
×
23
  end
24

25
  def on_site_holding?
1✔
26
    return true if aeon
10✔
27
    on_site_locations? || on_site_sc_locations?
9✔
28
  end
29

30
  # Holdings in these location are for on-site use only
31
  def on_site_locations?
1✔
32
    ["lewis$map", "lewis$maplf", "lewis$maplref", "lewis$mapmc", "lewis$mapmcm"].include?(library_location_code)
9✔
33
  end
34

35
  def on_site_sc_locations?
1✔
36
    additional_locations = ["rare$xmr", "mudd$scamudd", "rare$xrr",
8✔
37
                            "rare$xgr", "rare$xcr", "mudd$phr"]
38
    library_location_code.start_with?('rare$sca') || additional_locations.include?(library_location_code)
8✔
39
  end
40

41
  def library_location_code
1✔
42
    "#{holding['library_code']}$#{holding['location_code']}"
24✔
43
  end
44
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