Sha256: 3aa5e5fcffb99fb9f42f3b691ff204d6e556366f0d9c29065d382297fdfa4c1f

Contents?: true

Size: 1.16 KB

Versions: 8

Compression:

Stored size: 1.16 KB

Contents

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

module Contrast
  module Agent
    module DiagnosticsConfig
      # All In effect config values stored in a easy to write representation.
      class EffectiveConfigValue
        # @return [String] Name of the config starting form root of yaml config.
        attr_accessor :canonical_name
        # @return [String] Name of the config.
        attr_accessor :name
        # @return [String] Value set for the config.
        attr_accessor :value
        # @return [String] The source for the entry in the config.
        attr_accessor :source
        # @return [String,nil] The filename for the source of the config, if the source was "yaml".
        attr_accessor :filename

        def to_controlled_hash
          {
              canonical_name: canonical_name,
              name: name, # rubocop:disable Security/Module/Name
              value: value&.cs__is_a?(Array) ? value.map(&:to_s) : value.to_s,
              source: source,
              filename: filename
          }.compact
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
contrast-agent-7.0.0 lib/contrast/config/effective_config_value.rb
contrast-agent-6.15.3 lib/contrast/config/effective_config_value.rb
contrast-agent-6.15.2 lib/contrast/config/effective_config_value.rb
contrast-agent-6.15.1 lib/contrast/config/effective_config_value.rb
contrast-agent-6.15.0 lib/contrast/config/effective_config_value.rb
contrast-agent-6.14.0 lib/contrast/config/effective_config_value.rb
contrast-agent-6.13.0 lib/contrast/config/effective_config_value.rb
contrast-agent-6.12.0 lib/contrast/config/effective_config_value.rb