Sha256: e89ca9da4deef925f840f2ed41febc56d6ace1b7ae87fda6c6b525405c5a690a

Contents?: true

Size: 830 Bytes

Versions: 6

Compression:

Stored size: 830 Bytes

Contents

require "datadog/core/configuration/base"

module Datadog
  module CI
    module Contrib
      # Common settings for all integrations
      # @public_api
      class Settings
        include Core::Configuration::Base

        option :enabled, default: true
        option :service_name

        # @deprecated Will be removed in 1.0
        option :operation_name

        def configure(options = {})
          self.class.options.each do |name, _value|
            self[name] = options[name] if options.key?(name)
          end

          yield(self) if block_given?
        end

        def [](name)
          respond_to?(name) ? send(name) : get_option(name)
        end

        def []=(name, value)
          respond_to?(:"#{name}=") ? send(:"#{name}=", value) : set_option(name, value)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datadog-ci-0.8.3 lib/datadog/ci/contrib/settings.rb
datadog-ci-0.8.2 lib/datadog/ci/contrib/settings.rb
datadog-ci-0.8.1 lib/datadog/ci/contrib/settings.rb
datadog-ci-0.8.0 lib/datadog/ci/contrib/settings.rb
datadog-ci-0.7.0 lib/datadog/ci/contrib/settings.rb
datadog-ci-0.6.0 lib/datadog/ci/contrib/settings.rb