Sha256: dddb3d28a2c504744fbb2c7c914763917695cc9ae45a20a3d01944f97bb92985

Contents?: true

Size: 945 Bytes

Versions: 8

Compression:

Stored size: 945 Bytes

Contents

# Copyright (c) 2022 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

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-6.1.2 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-6.1.1 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-6.1.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-6.0.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-5.3.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-5.2.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-5.1.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-5.0.0 lib/contrast/api/decorators/library_usage_update.rb