• 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/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
  # @param params [ActionController::Parameters]
32
  def initialize(adapter:, online_markup_builder:, physical_markup_builder:, params:)
×
33
    @adapter = adapter
×
34
    @online_markup_builder = online_markup_builder
×
35
    @physical_markup_builder = physical_markup_builder
×
36
    @params = params
×
37
  end
×
38

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

45
    physical_builder = @physical_markup_builder.new(@adapter, params)
×
46
    physical_markup = physical_builder.build
×
47

48
    physical_markup = self.class.missing_holdings if physical_markup.blank? && online_markup.blank?
×
49

50
    [online_markup, physical_markup]
×
51
  end
×
52

53
  private
×
54

55
    attr_reader :params
×
56
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