Sha256: e1ead30fdf83aff3e22d7df0f21b10b112040dbb1378d0896b07153f935c3a10

Contents?: true

Size: 991 Bytes

Versions: 10

Compression:

Stored size: 991 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/components/base'

module Contrast
  module Components
    module Inventory
      # Interface component for Inventory settings used to store the values from
      # settings file and assert state with check methods.
      class Interface
        include Contrast::Components::ComponentBase

        # @return [Array, nil] tags
        attr_accessor :tags

        def initialize hsh = {}
          return unless hsh

          @enable = !false?(hsh[:enable])
          @analyze_libraries = !false?(hsh[:analyze_libraries])
          @tags = hsh[:tags]
        end

        # return [Boolean]
        def enable
          @enable.nil? ? true : @enable
        end

        # return [Boolean]
        def analyze_libraries
          @analyze_libraries.nil? ? true : @analyze_libraries
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
contrast-agent-6.8.0 lib/contrast/components/inventory.rb
contrast-agent-6.7.0 lib/contrast/components/inventory.rb
contrast-agent-6.6.5 lib/contrast/components/inventory.rb
contrast-agent-6.6.4 lib/contrast/components/inventory.rb
contrast-agent-6.6.3 lib/contrast/components/inventory.rb
contrast-agent-6.6.2 lib/contrast/components/inventory.rb
contrast-agent-6.6.1 lib/contrast/components/inventory.rb
contrast-agent-6.6.0 lib/contrast/components/inventory.rb
contrast-agent-6.5.1 lib/contrast/components/inventory.rb
contrast-agent-6.5.0 lib/contrast/components/inventory.rb