Class: Qonfig::Commands::Compose Private

Inherits:
Base
  • Object
show all
Defined in:
lib/qonfig/commands/compose.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

Constructor Details

#initialize(data_set_klass) ⇒ Compose

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 Compose.

Parameters:

Raises:

Since:

  • 0.1.0



20
21
22
23
24
25
26
27
# File 'lib/qonfig/commands/compose.rb', line 20

def initialize(data_set_klass)
  raise(
    Qonfig::ArgumentError,
    'Composed config class should be a subtype of Qonfig::DataSet'
  ) unless data_set_klass.is_a?(Class) && data_set_klass < Qonfig::DataSet

  @data_set_klass = data_set_klass
end

Instance Attribute Details

#data_set_klassQonfig::DataSet (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:

Since:

  • 0.1.0



12
13
14
# File 'lib/qonfig/commands/compose.rb', line 12

def data_set_klass
  @data_set_klass
end

Instance Method Details

#call(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



34
35
36
37
38
# File 'lib/qonfig/commands/compose.rb', line 34

def call(settings)
  composite_settings = data_set_klass.new.settings

  settings.__append_settings__(composite_settings)
end