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

pulibrary / bibdata / 2ee2c4fc-5ef0-4806-b86e-01bf70aa67a0

24 Dec 2024 04:55PM UTC coverage: 91.859% (-0.04%) from 91.902%
2ee2c4fc-5ef0-4806-b86e-01bf70aa67a0

Pull #2569

circleci

christinach
Generate new .rubocop_todo.yml
rubocop fix
Pull Request #2569: Rubocop gems

335 of 378 new or added lines in 57 files covered. (88.62%)

2 existing lines in 2 files now uncovered.

3385 of 3685 relevant lines covered (91.86%)

377.92 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

8
  # @param bib [Alma::Bib]
9
  # @param holding [Hash] Holding data pulled from Alma::AvailabilityResponse
10
  # @param aeon [Bool] Is Aeon location?
11
  def initialize(bib:, holding:, aeon: false)
1✔
12
    @bib = bib
10✔
13
    @holding = holding
10✔
14
    @aeon = aeon
10✔
15
  end
16

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

22
    # For electronic holdings
NEW
23
    return holding['activation_status'].titlecase if holding['activation_status']
×
24
  end
25

26
  def on_site_holding?
1✔
27
    return true if aeon
10✔
28

29
    on_site_locations? || on_site_sc_locations?
9✔
30
  end
31

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

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

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