Sha256: b6a9b3bbc5d5e9354996676616eeab4168196b3bd1d48b666681e51b0da9d5a9

Contents?: true

Size: 923 Bytes

Versions: 9

Compression:

Stored size: 923 Bytes

Contents

# frozen_string_literal: true

module Qonfig
  module Commands
    # @api private
    # @since 0.1.0
    class AddOption < Base
      # @return [Symbol, String]
      #
      # @api private
      # @since 0.1.0
      attr_reader :key

      # @return [Object]
      #
      # @api private
      # @since 0.1.0
      attr_reader :value

      # @param key [Symbol, String]
      # @param value [Object]
      #
      # @raise [Qonfig::ArgumentError]
      # @raise [Qonfig::CoreMethodIntersectionError]
      #
      # @api private
      # @since 0.1.0
      def initialize(key, value)
        Qonfig::Settings::KeyGuard.prevent_incomparabilities!(key)

        @key = key
        @value = value
      end

      # @param settings [Qonfig::Settings]
      # @return [void]
      #
      # @api private
      # @since 0.1.0
      def call(settings)
        settings.__define_setting__(key, value)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
qonfig-0.10.0 lib/qonfig/commands/add_option.rb
qonfig-0.9.0 lib/qonfig/commands/add_option.rb
qonfig-0.8.0 lib/qonfig/commands/add_option.rb
qonfig-0.7.0 lib/qonfig/commands/add_option.rb
qonfig-0.6.0 lib/qonfig/commands/add_option.rb
qonfig-0.5.0 lib/qonfig/commands/add_option.rb
qonfig-0.4.0 lib/qonfig/commands/add_option.rb
qonfig-0.3.0 lib/qonfig/commands/add_option.rb
qonfig-0.2.0 lib/qonfig/commands/add_option.rb