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.
 
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.
      18 19 20 21 22 23 24 25 26 27  | 
    
      # File 'lib/qonfig/commands/definition/compose.rb', line 18 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.
      10 11 12  | 
    
      # File 'lib/qonfig/commands/definition/compose.rb', line 10 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.
      35 36 37 38 39 40 41 42  | 
    
      # File 'lib/qonfig/commands/definition/compose.rb', line 35 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  |