Sha256: 5c666c0b9cfbf18557ce1970420a8351093862bc89a3df8fc19db9910c77ac71

Contents?: true

Size: 893 Bytes

Versions: 97

Compression:

Stored size: 893 Bytes

Contents

module CC
  class Config
    class Engine
      DEFAULT_CHANNEL = "stable".freeze

      attr_accessor :channel
      attr_reader :name, :config, :exclude_patterns
      attr_writer :enabled

      def initialize(name, enabled: false, channel: nil, config: nil, exclude_patterns: [])
        @name = name
        @enabled = enabled
        @channel = channel || DEFAULT_CHANNEL
        @config = config || {}
        @exclude_patterns = exclude_patterns
      end

      def enabled?
        @enabled
      end

      def plugin?
        !DefaultAdapter::ENGINES.keys.include?(name)
      end

      def container_label
        @container_label ||= SecureRandom.uuid
      end

      def hash
        name.hash
      end

      def eql?(other)
        other.is_a?(self.class) && name.eql?(other.name)
      end
      alias_method :==, :eql?
      alias_method :equal?, :eql?
    end
  end
end

Version data entries

97 entries across 97 versions & 2 rubygems

Version Path
codeclimate-0.85.27 lib/cc/config/engine.rb
codeclimate-0.85.26 lib/cc/config/engine.rb
codeclimate-0.85.25 lib/cc/config/engine.rb
codeclimate-0.85.24 lib/cc/config/engine.rb
codeclimate-fede-0.85.54 lib/cc/config/engine.rb
codeclimate-fede-0.85.53 lib/cc/config/engine.rb
codeclimate-fede-0.85.52 lib/cc/config/engine.rb
codeclimate-fede-0.85.51 lib/cc/config/engine.rb
codeclimate-fede-0.85.50 lib/cc/config/engine.rb
codeclimate-fede-0.85.49 lib/cc/config/engine.rb
codeclimate-fede-0.85.48 lib/cc/config/engine.rb
codeclimate-fede-0.85.47 lib/cc/config/engine.rb
codeclimate-fede-0.85.46 lib/cc/config/engine.rb
codeclimate-fede-0.85.45 lib/cc/config/engine.rb
codeclimate-fede-0.85.44 lib/cc/config/engine.rb
codeclimate-fede-0.85.43 lib/cc/config/engine.rb
codeclimate-fede-0.85.42 lib/cc/config/engine.rb
codeclimate-fede-0.85.41 lib/cc/config/engine.rb
codeclimate-fede-0.85.40 lib/cc/config/engine.rb
codeclimate-fede-0.85.39 lib/cc/config/engine.rb