Module: Hocon::Impl::Container

Includes:
ConfigValue
Included in:
AbstractConfigObject, ConfigConcatenation, ReplaceableMergeStack, SimpleConfigList
Defined in:
lib/hocon/impl/container.rb

Overview

An AbstractConfigValue which contains other values. Java has no way to express “this has to be an AbstractConfigValue also” other than making AbstractConfigValue an interface which would be aggravating. But we can say we are a ConfigValue.

Instance Method Summary collapse

Methods included from ConfigValue

#at_key, #at_path, #origin, #render, #unwrapped, #value_type, #with_fallback, #with_origin

Methods included from ConfigMergeable

#with_fallback

Instance Method Details

#has_descendant?(descendant) ⇒ Boolean

Super-expensive full traversal to see if descendant is anywhere underneath this container.

Returns:

  • (Boolean)

Raises:



26
27
28
# File 'lib/hocon/impl/container.rb', line 26

def has_descendant?(descendant)
  raise Hocon::ConfigError::ConfigBugOrBrokenError, "subclasses of `Container` must implement `has_descendant?` (#{self.class})"
end

#replace_child(child, replacement) ⇒ Object

Replace a child of this value. CAUTION if replacement is null, delete the child, which may also delete the parent, or make the parent into a non-container.



18
19
20
# File 'lib/hocon/impl/container.rb', line 18

def replace_child(child, replacement)
  raise Hocon::ConfigError::ConfigBugOrBrokenError, "subclasses of `Container` must implement `replace_child` (#{self.class})"
end