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

7
      def initialize(patron:, bib:, item:, note: "Digitization Request", cited_pages: '')
×
8
        @patron = patron
×
9
        @bib = bib
×
10
        @item = item
×
11
        @note = note
×
12
        @note = "#{@note}: #{item['edd_note']}".truncate(4000) if item["edd_note"].present?
×
13
        @cited_pages = cited_pages.truncate(30)
×
14
        @illiad_transaction_status = "Awaiting Article Express Processing"
×
15
        @attributes = map_metdata
×
16
      end
×
17

18
      private
×
19

20
        def map_metdata
×
21
          Metadata.new(
×
22
            patron.netid, illiad_transaction_status, "Article", "Borrowing",
×
23
            (DateTime.current + 6.months).strftime("%m/%d/%Y"),
×
24
            "Yes, until the semester's", # NOTE: creation fails if we use any other text value
×
25
            bib["author"]&.truncate(100), item["edd_author"]&.truncate(100),
×
26
            bib["title"]&.truncate(255), item["edd_publisher"]&.truncate(40),
×
27
            bib["isbn"], item["edd_call_number"]&.truncate(255),
×
28
            pages&.truncate(30),
×
29
            "#{Requests.config[:pulsearch_base]}/catalog/#{bib['id']}",
×
30
            item["edd_date"], volume_number(item),
×
31
            item["edd_issue"]&.truncate(30),
×
32
            item["edd_volume_number"]&.truncate(255),
×
33
            item["edd_issue"]&.truncate(255), cited_pages,
×
34
            true, item["edd_oclc_number"]&.truncate(32),
×
35
            genre, item["edd_location"],
×
36
            item["edd_art_title"]&.truncate(250)
×
37
          ).to_metadata_hash
×
38
        end
×
39

40
        def pages
×
41
          "#{item['edd_start_page']}-#{item['edd_end_page']}"
×
42
        end
×
43

44
        def genre
×
45
          case item["edd_genre"]
×
46
          when "article"
×
47
            "Article"
×
48
          when "bookitem"
×
49
            "Book Chapter"
×
50
          when "dissertation"
×
51
            "Thesis"
×
52
          else
×
53
            "Book"
×
54
          end
×
55
        end
×
56

57
        def volume_number(item)
×
58
          vol = []
×
59
          vol << item["user_supplied_enum"] if item["user_supplied_enum"].present?
×
60
          vol << item["edd_volume_number"] if item["edd_volume_number"].present?
×
61
          vol.join(', ')&.truncate(30)
×
62
        end
×
63
    end
×
64
  end
×
65
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