• 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/components/holdings/plain_text_component.rb
1
# frozen_string_literal: true
2

3
# A View Component that is responsible for formatting a record's holdings
4
# (including bound-with holdings) in a way suitable for plain-text contexts,
5
# like a plain-text email.
6
class Holdings::PlainTextComponent < ViewComponent::Base
×
7
  def initialize(document)
×
8
    @document = document
×
9
  end
×
10

11
  def call
×
12
    return if formatted_holdings_data.blank?
×
13
    "Holdings:\n#{formatted_holdings_data}"
×
14
  end
×
15

16
  private
×
17

18
    # :reek:DuplicateMethodCall
19
    # :reek:FeatureEnvy
20
    def formatted_holdings_data
×
21
      @formatted_holdings_data ||= document.holdings_all_display&.values&.map do |holdings_data|
×
22
        location_statement = "\n\tLocation: #{holdings_data['library']}"
×
23
        location_statement << " - #{holdings_data['location']}" if holdings_data['location']
×
24
        location_statement << "\n\tCall number: #{holdings_data['call_number']}" if holdings_data['call_number']
×
25
        location_statement
×
26
      end&.join("\n")
×
27
    end
×
28
    attr_reader :document
×
29
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