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

pulibrary / orangelight / 62bad3f1-d46d-40af-822c-403d653da2a8

17 Jun 2025 05:30PM UTC coverage: 0.447% (-94.9%) from 95.337%
62bad3f1-d46d-40af-822c-403d653da2a8

push

circleci

maxkadel
Install chrome & chromedriver for smoke specs

43 of 9610 relevant lines covered (0.45%)

0.01 hits per line

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

0.0
/app/models/requests/submissions/clancy.rb
1
# frozen_string_literal: true
2
require 'faraday'
×
3

4
module Requests::Submissions
×
5
  class Clancy < Service
×
6
    def initialize(submission)
×
7
      super(submission, service_type: 'clancy_in_library')
×
8
    end
×
9

10
    def handle
×
11
      items = @submission.filter_items_by_service(service_type)
×
12
      items.each do |item|
×
13
        handle_item(item)
×
14
      end
×
15
    end
×
16

17
    private
×
18

19
      def handle_item(item)
×
20
        # place the item on hold
21
        hold = Requests::Submissions::HoldItem.new(@submission, service_type: item["type"])
×
22
        hold.handle
×
23

24
        if hold.errors.empty?
×
25
          # request it from the clancy facility
26
          clancy_item = Requests::ClancyItem.new(barcode: item[:barcode])
×
27
          status = clancy_item.request(patron: @submission.patron, hold_id: hold_id(item_barcode: item[:barcode], patron_barcode: @submission.patron.barcode))
×
28
          @errors << { type: 'clancy', error: clancy_item.errors.first, bibid: item[:bibid], barcode: item[:barcode] } unless status
×
29
        else
×
30
          @errors << hold.errors.first.merge(type: 'clancy_hold')
×
31
        end
×
32
      end
×
33

34
      def hold_id(item_barcode:, patron_barcode:)
×
35
        id = "#{item_barcode}-#{patron_barcode}-#{Time.zone.now.to_i}"
×
36
        Rails.logger.debug { "Requesting clancy item with id: #{id}" }
×
37
        id
×
38
      end
×
39
  end
×
40
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