• 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/alma_patron.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  # Create a Patron from the Alma gem API directly, rather than via Bibdata
4
  class AlmaPatron
×
5
    def initialize(uid:)
×
6
      @uid = uid
×
7
    end
×
8

9
    def patron_hash
×
10
      {
×
11
        last_name:,
×
12
        active_email:,
×
13
        barcode:,
×
14
        barcode_status: 1,
×
15
        netid: "ALMA",
×
16
        university_id: uid,
×
17
        patron_group:
×
18
      }.with_indifferent_access
×
19
    end
×
20

21
    private
×
22

23
      def alma_user
×
24
        @alma_user ||= Alma::User.find(uid)
×
25
      end
×
26

27
      def barcode
×
28
        active_barcode || "ALMA"
×
29
      end
×
30

31
      def active_barcode
×
32
        alma_user["user_identifier"].find do |id|
×
33
          id["id_type"]["value"] == "BARCODE" && id["status"] == "ACTIVE"
×
34
        end["value"]
×
35
      end
×
36

37
      def last_name
×
38
        alma_user.preferred_last_name
×
39
      end
×
40

41
      def active_email
×
42
        alma_user.preferred_email
×
43
      end
×
44

45
      def patron_group
×
46
        alma_user["user_group"]["value"]
×
47
      end
×
48

49
      attr_reader :uid
×
50
  end
×
51
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