Sha256: 398b6397935728843edf1ee025422d81d843be09667f42178ecbe18d7eaa5ba7

Contents?: true

Size: 882 Bytes

Versions: 13

Compression:

Stored size: 882 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class Qonfig::Commands::Definition::AddOption < Qonfig::Commands::Base
  # @since 0.19.0
  self.inheritable = true

  # @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 data_set [Qonfig::DataSet]
  # @param settings [Qonfig::Settings]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def call(data_set, settings)
    settings.__define_setting__(key, value)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
qonfig-0.30.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.28.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.27.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.26.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.25.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.24.1 lib/qonfig/commands/definition/add_option.rb
qonfig-0.24.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.23.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.22.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.21.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.20.0 lib/qonfig/commands/definition/add_option.rb
qonfig-0.19.1 lib/qonfig/commands/definition/add_option.rb
qonfig-0.19.0 lib/qonfig/commands/definition/add_option.rb