Sha256: a7601e8642600068516d8b2bdb6ecd576c3b67eecfd5042d4ce0dadba03fedd6

Contents?: true

Size: 777 Bytes

Versions: 2

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class Qonfig::Commands::AddOption < Qonfig::Commands::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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qonfig-0.12.0 lib/qonfig/commands/add_option.rb
qonfig-0.11.0 lib/qonfig/commands/add_option.rb