• 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/services/holding_requests_builder.rb
1
# frozen_string_literal: true
2

3
class HoldingRequestsBuilder
×
4
  extend ActionView::Helpers::TagHelper
×
5
  extend ActionView::Helpers::UrlHelper
×
6

7
  # Generate <div> container for a holding block
8
  # @param children [String] the children for the holding block
9
  # @return [String] the markup
10
  def self.holding_block(children)
×
11
    content_tag(:tr, children.html_safe, class: 'holding-block') unless children.empty?
×
12
  end
×
13

14
  # Generate <div> container for holding details
15
  # @param children [String] the children for the holding details
16
  # @return [String] the markup
17
  def self.holding_details(children)
×
18
    content_tag(:td, children.html_safe, class: 'holding-details') unless children.empty?
×
19
  end
×
20

21
  # Generate <div> container for missing item holdings
22
  # @return [String] the markup
23
  def self.missing_holdings
×
24
    holding_block(I18n.t('blacklight.holdings.missing'))
×
25
  end
×
26

27
  # Constructor
28
  # @param adapter [HoldingRequestsAdapter] adapter for the SolrDocument and Bibdata API
29
  # @param online_markup_builder [Class] the builder class for online holdings blocks
30
  # @param physical_markup_builder [Class] the builder class for physical holdings blocks
31
  def initialize(adapter:, online_markup_builder:, physical_markup_builder:)
×
32
    @adapter = adapter
×
33
    @online_markup_builder = online_markup_builder
×
34
    @physical_markup_builder = physical_markup_builder
×
35
  end
×
36

37
  # Builds the markup for online and physical holdings for a given record
38
  # @return [Array<String>] the markup for the online and physical holdings
39
  def build
×
40
    online_builder = @online_markup_builder.new(@adapter)
×
41
    online_markup = online_builder.build
×
42

43
    physical_builder = @physical_markup_builder.new(@adapter)
×
44
    physical_markup = physical_builder.build
×
45

46
    physical_markup = self.class.missing_holdings if physical_markup.blank? && online_markup.blank?
×
47

48
    [online_markup, physical_markup]
×
49
  end
×
50
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