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

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

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

0.0
/app/models/requests/router.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  # This class assigns "services" a given requestable object is available through
4
  class Router
×
5
    attr_reader :user, :patron, :any_loanable, :requestable
×
6

7
    delegate :cas_provider?, :alma_provider?, to: :user
×
8

9
    def initialize(requestable:, any_loanable: false, patron: nil)
×
10
      @requestable = requestable
×
11
      @user = patron.user
×
12
      @patron = patron
×
13
      @any_loanable = any_loanable
×
14
    end
×
15

16
    # Current Service Types Assigned
17
    # :aeon - material is stored in a location where it can be requested via Aeon
18
    # :annex - material is stored in an Annex location
19
    # :on_shelf - material is stored in a campus library location
20
    # :on_shelf_edd - material is in a campus library location that is eligible for digitization
21
    # :on_order - material has a status in Alma that indicates it is ordered but has not yet arrived on campus
22
    # :in_process - material has a status in Alma that indicates it has arrived on campus but has not been processed and shelved
23
    # :recap - material is stored at recap; can be paged to campus and circulates
24
    # :recap_in_library - material is stored at recap; can be paged to campus, but does not circulate
25
    # :recap_edd - material is stored in a recap location that permits digitization
26
    # :recap_no_items - material in a recap location with no item record data
27
    # :ill - material has a status in Alma making it unavailable for circulation and is in a location that is eligible for resource sharing
28
    # :clancy_unavailable - item is at clancy but clancy system says it is not available; but its alma status is available
29
    # :clancy_in_library - item in the clancy warehouse and can be paged to marquand
30
    # :clancy_edd - item in the clancy warehouse in a location that permits digitization
31
    # :marquand_in_library - non clancy marquand item in a location that can be paged to marquand
32
    # :marquand_edd - non clancy marquand item in a location that is permitted to be scanned
33
    # :ask_me - catchall service if the item isn't eligible for anything else.
34

35
    def routed_request
×
36
      requestable.replace_existing_services calculate_services
×
37
      requestable
×
38
    end
×
39

40
    # returns a hash of symbols with service objects as values
41
    # services[:service_name] = Requests::Service::GenericService
42
    def calculate_services
×
43
      eligibility_checks.select(&:eligible?).map(&:to_s)
×
44
    end
×
45

46
    private
×
47

48
      def eligibility_checks
×
49
        [
×
50
          ServiceEligibility::ILL.new(requestable:, patron:, any_loanable:),
×
51
          ServiceEligibility::OnOrder.new(requestable:, user:),
×
52
          ServiceEligibility::Annex.new(requestable:, patron:),
×
53
          ServiceEligibility::OnShelfDigitize.new(requestable:, patron:),
×
54
          ServiceEligibility::OnShelfPickup.new(requestable:, patron:),
×
55
          ServiceEligibility::ClancyUnavailable.new(requestable:, user:),
×
56
          ServiceEligibility::ClancyInLibrary.new(requestable:, user:),
×
57
          ServiceEligibility::ClancyEdd.new(requestable:, patron:),
×
58
          ServiceEligibility::InProcess.new(requestable:, user:),
×
59
          ServiceEligibility::MarquandInLibrary.new(requestable:, user:),
×
60
          ServiceEligibility::MarquandEdd.new(requestable:, user:),
×
61
          ServiceEligibility::Recap::NoItems.new(requestable:, user:),
×
62
          ServiceEligibility::Recap::InLibrary.new(requestable:, user:),
×
63
          ServiceEligibility::Recap::AskMe.new(requestable:, user:),
×
64
          ServiceEligibility::Recap::Digitize.new(requestable:, user:),
×
65
          ServiceEligibility::Recap::Pickup.new(requestable:, user:),
×
66
          ServiceEligibility::Aeon.new(requestable:)
×
67
        ]
×
68
      end
×
69
  end
×
70
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