class Qonfig::Compacted

@api public @since 0.21.0

@api public @since 0.21.0

Attributes

____data_set____[R]

@return [Qonfig::DataSet]

@api private @since 0.21.0

Public Class Methods

build(base_config_klass = self, &config_klass_definitions) click to toggle source

@param base_config_klass [Class<Qonfig::Compacted>] @param config_klass_definitions [Block] @return [Qonfig::Compacted]

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 18
def build(base_config_klass = self, &config_klass_definitions)
  raise(
    ::Qonfig::ArgumentError,
    'Base class should be a type of Qonfig::Compacted'
  ) unless base_config_klass <= ::Qonfig::Compacted

  Class.new(base_config_klass, &config_klass_definitions).new
end
build_from( data_set = ::Qonfig::Compacted::Constructor::NO_INITIAL_DATA_SET, &configurations ) click to toggle source

@param data_set [Qonfig::DataSet] @param configurations [Block] @return [Qonfig::Compacted]

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 33
def build_from(
  data_set = ::Qonfig::Compacted::Constructor::NO_INITIAL_DATA_SET,
  &configurations
)
  compacted_config = allocate # NOTE: #tap does not exist on BasicObject :(
  ::Qonfig::Compacted::Constructor.construct(compacted_config, data_set, &configurations)
  compacted_config
end
new(settings_map = {}, &configuration) click to toggle source

@param settings_map [Hash<Symbol|String,Any>] @param configuration [Block] @return [void]

@see Qonfig::Compacted::Constructor

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 71
def initialize(settings_map = {}, &configuration)
  ::Qonfig::Compacted::Constructor.construct(
    self,
    ::Qonfig::Compacted::Constructor::NO_INITIAL_DATA_SET,
    settings_map: settings_map,
    &configuration
  )
end
valid_with?(settings_map = {}, &configurations) click to toggle source

@param settings_map [Hash<Symbol|String,Any>] @option init_from [NilClass, Qonfig::DataSet] @param configurations [Block] @return [Boolean]

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 49
def valid_with?(settings_map = {}, &configurations)
  new(settings_map, &configurations)
  true
rescue ::Qonfig::ValidationError
  false
end

Public Instance Methods

[](key) click to toggle source

@param key [String, Symbol] @return [Any]

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 85
def [](key)
  ____data_set____[key]
end
[]=(key, value) click to toggle source

@param key [String, Symbol] @param value [Any] @return [void]

@api public @since 0.21.0

# File lib/qonfig/compacted.rb, line 95
def []=(key, value)
  ____data_set____[key] = value
end