Sha256: 7fc0112b7bed4e158f90157bad0a0a7456e0271dd0f77576892c19730b8c8a53

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/utils/string_utils'

module Contrast
  module Api
    module Decorators
      # Used to decorate the LibraryUsageUpdate protobuf
      module LibraryUsageUpdate
        def self.included klass
          klass.extend(ClassMethods)
        end
        # Used to add class methods to the LibraryUsageUpdate class on inclusion of the decorator
        module ClassMethods
          def build digest, files
            msg = new
            msg.hash_code = Contrast::Utils::StringUtils.force_utf8(digest)
            files.each do |required_file|
              msg.class_names[required_file] = true
            end
            msg
          end
        end
      end
    end
  end
end

Contrast::Api::Dtm::LibraryUsageUpdate.include(Contrast::Api::Decorators::LibraryUsageUpdate)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
contrast-agent-4.2.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.1.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.0.0 lib/contrast/api/decorators/library_usage_update.rb