Sha256: 9ffe61fdd2adb4532778b1b9367a235551d0d09b4e5983a6076b3e939e3058ef

Contents?: true

Size: 945 Bytes

Versions: 13

Compression:

Stored size: 945 Bytes

Contents

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

13 entries across 13 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.14.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.13.1 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.13.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.12.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.11.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.10.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.9.1 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.9.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.8.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.7.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.6.0 lib/contrast/api/decorators/library_usage_update.rb
contrast-agent-4.5.0 lib/contrast/api/decorators/library_usage_update.rb