Class: Qonfig::Commands::Definition::AddOption Private

Inherits:
Base
  • Object
show all
Defined in:
lib/qonfig/commands/definition/add_option.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inheritable=, inheritable?, #inheritable?, inherited

Constructor Details

#initialize(key, value) ⇒ AddOption

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AddOption.

Parameters:

  • key (Symbol, String)
  • value (Object)

Raises:

Since:

  • 0.1.0



29
30
31
32
33
34
# File 'lib/qonfig/commands/definition/add_option.rb', line 29

def initialize(key, value)
  Qonfig::Settings::KeyGuard.prevent_incomparabilities!(key)

  @key = key
  @value = value
end

Instance Attribute Details

#keySymbol, String (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Symbol, String)

Since:

  • 0.1.0



13
14
15
# File 'lib/qonfig/commands/definition/add_option.rb', line 13

def key
  @key
end

#valueObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Object)

Since:

  • 0.1.0



19
20
21
# File 'lib/qonfig/commands/definition/add_option.rb', line 19

def value
  @value
end

Instance Method Details

#call(data_set, settings) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

Since:

  • 0.1.0



42
43
44
# File 'lib/qonfig/commands/definition/add_option.rb', line 42

def call(data_set, settings)
  settings.__define_setting__(key, value)
end