• 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/concerns/requests/aeon.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  module Aeon
×
4
    # for Aeon Related Bibliographic Helpers
5
    extend ActiveSupport::Concern
×
6

7
    def aeon_mapped_params
×
8
      params = {
×
9
        Action: '10',
×
10
        Form: '21',
×
11
        ItemTitle: aeon_title.truncate(247),
×
12
        ItemAuthor: author,
×
13
        ItemDate: pub_date,
×
14
        ItemVolume: item_volume
×
15
      }
×
16
      params[:ItemNumber] = item[:barcode] if barcode?
×
17
      params.merge! aeon_basic_params
×
18
      params.reject { |_k, v| v.nil? }
×
19
    end
×
20

21
    ## params shared by both alma and non-alma aeon requests
22
    def aeon_basic_params
×
23
      {
×
24
        ReferenceNumber: bib[:id],
×
25
        CallNumber: call_number,
×
26
        Site: site,
×
27
        Location: shelf_location_code,
×
28
        SubLocation: sub_location,
×
29
        ItemInfo1: bib[:access_restrictions_note_display]&.first || I18n.t("requests.aeon.access_statement")
×
30
      }.compact
×
31
    end
×
32

33
    def aeon_request_url
×
34
      AeonUrl.new(document: bib, holding: holding.to_h, item:).to_s
×
35
    end
×
36

37
    def site
×
38
      if location[:holding_library].present?
×
39
        holding_location_to_site(location['holding_library']['code'])
×
40
      elsif location['library']['code'] == 'eastasian' && aeon_location?
×
41
        'EAL'
×
42
      elsif location['library']['code'] == 'marquand'  && aeon_location?
×
43
        'MARQ'
×
44
      elsif location['library']['code'] == 'mudd'
×
45
        'MUDD'
×
46
      else
×
47
        "FIRE"
×
48
      end
×
49
    end
×
50

51
    private
×
52

53
      def holding_location_to_site(location_code)
×
54
        if  location_code == 'eastasian' && aeon_location?
×
55
          'EAL'
×
56
        elsif location_code == 'marquand' && aeon_location?
×
57
          'MARQ'
×
58
        elsif location_code == 'mudd' && aeon_location?
×
59
          'MUDD'
×
60
        else
×
61
          'FIRE'
×
62
        end
×
63
      end
×
64

65
      def aeon_location?
×
66
        location['aeon_location'] == true
×
67
      end
×
68

69
      def call_number
×
70
        holding.holding_data['call_number']
×
71
      end
×
72

73
      def pub_date
×
74
        bib[:pub_date_start_sort]
×
75
      end
×
76

77
      def shelf_location_code
×
78
        holding.holding_data['location_code']
×
79
      end
×
80

81
      def item_volume
×
82
        item.description if item.present? && enumerated?
×
83
      end
×
84

85
      def sub_location
×
86
        holding.holding_data['sub_location']&.first
×
87
      end
×
88

89
      def aeon_title
×
90
        "#{bib[:title_display]}#{genre}"
×
91
      end
×
92

93
      ## Don T requested this be appended when present
94
      def genre
×
95
        " [ #{bib[:form_genre_display].first} ]" unless bib[:form_genre_display].nil?
×
96
      end
×
97

98
      def author
×
99
        bib[:author_display]&.join(" AND ")
×
100
      end
×
101
  end
×
102
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