Class: Qonfig::Commands::Definition::Compose Private
- Defined in:
- lib/qonfig/commands/definition/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.
Instance Attribute Summary collapse
- #composable_data_set_klass ⇒ Qonfig::DataSet readonly private
Instance Method Summary collapse
- #call(data_set, settings) ⇒ void private
-
#initialize(composable_data_set_klass) ⇒ Compose
constructor
private
A new instance of Compose.
Methods inherited from Base
inheritable=, inheritable?, #inheritable?, inherited
Constructor Details
#initialize(composable_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.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/qonfig/commands/definition/compose.rb', line 21 def initialize(composable_data_set_klass) unless composable_data_set_klass.is_a?(Class) && composable_data_set_klass < Qonfig::DataSet raise( Qonfig::ArgumentError, 'Composed config class should be a subtype of Qonfig::DataSet' ) end @composable_data_set_klass = composable_data_set_klass end |
Instance Attribute Details
#composable_data_set_klass ⇒ Qonfig::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.
13 14 15 |
# File 'lib/qonfig/commands/definition/compose.rb', line 13 def composable_data_set_klass @composable_data_set_klass 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.
38 39 40 41 42 43 44 45 |
# File 'lib/qonfig/commands/definition/compose.rb', line 38 def call(data_set, settings) # NOTE: append new validators data_set.class.validators.concat(composable_data_set_klass.validators.dup) # NOTE: append new settings composite_settings = composable_data_set_klass.new.settings settings.__append_settings__(composite_settings) end |