• 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/illiad_metadata/loan.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  module IlliadMetadata
×
4
    class Loan
×
5
      attr_reader :patron, :bib, :item, :note, :illiad_transaction_status, :attributes
×
6

7
      def initialize(patron:, bib:, item:, note: "Loan Request")
×
8
        @patron = patron
×
9
        @bib = bib
×
10
        @item = item
×
11
        @note = note&.truncate(4000)
×
12
        @illiad_transaction_status = "Awaiting Request Processing"
×
13
        @attributes = map_metdata
×
14
      end
×
15

16
      private
×
17

18
        def map_metdata
×
19
          {
×
20
            "Username" => patron.netid, "TransactionStatus" => illiad_transaction_status,
×
21
            "RequestType" => "Loan", "ProcessType" => "Borrowing", "NotWantedAfter" => (DateTime.current + 6.months).strftime("%m/%d/%Y"),
×
22
            "WantedBy" => "Yes, until the semester's", # NOTE: creation fails if we use any other text value
×
23
            "LoanAuthor" => bib["author"]&.truncate(100), "LoanTitle" => bib["title"]&.truncate(255),
×
24
            "LoanPublisher" => item["edd_publisher"]&.truncate(40), "LoanDate" => bib["date"],
×
25
            "ISSN" => bib["isbn"], "CallNumber" => call_number(item),
×
26
            "CitedIn" => "#{Requests.config[:pulsearch_base]}/catalog/#{bib['id']}",
×
27
            "ItemInfo3" => volume_number(item)&.truncate(255), "ItemInfo4" => item["edd_issue"]&.truncate(255),
×
28
            "AcceptNonEnglish" => true, "ESPNumber" => item["edd_oclc_number"]&.truncate(32),
×
29
            "DocumentType" => genre, "LoanPlace" => item["edd_location"]
×
30
          }
×
31
        end
×
32

33
        def genre
×
34
          case item["edd_genre"]
×
35
          when "article"
×
36
            "Article"
×
37
          when "bookitem"
×
38
            "Book Chapter"
×
39
          when "dissertation"
×
40
            "Thesis"
×
41
          else
×
42
            "Book"
×
43
          end
×
44
        end
×
45

46
        def volume_number(item)
×
47
          vol = [item["user_supplied_enum"], item["edd_volume_number"], item["enum"]].compact_blank
×
48
          vol.join(', ')&.truncate(30)
×
49
        end
×
50

51
        def call_number(item)
×
52
          call_no = item["edd_call_number"] || item["call_number"]
×
53
          call_no&.truncate(255)
×
54
        end
×
55
    end
×
56
  end
×
57
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