Class: Hocon::Impl::ConfigString::Unquoted

Inherits:
Hocon::Impl::ConfigString show all
Defined in:
lib/hocon/impl/config_string.rb

Overview

this is sort of a hack; we want to preserve whether whitespace was quoted until we process substitutions, so we can ignore unquoted whitespace when concatenating lists or objects. We dump this distinction when serializing and deserializing, but that ‘s OK because it isn’ t in equals/hashCode, and we don ‘t allow serializing unresolved objects which is where quoted-ness matters. If we later make ConfigOrigin point to the original token range, we could use that to implement wasQuoted()

Constant Summary

Constants inherited from Hocon::Impl::ConfigString

ConfigImplUtil

Constants included from AbstractConfigValue

AbstractConfigValue::ConfigBugOrBrokenError, AbstractConfigValue::ConfigImplUtil, AbstractConfigValue::ResolveStatus

Instance Attribute Summary

Attributes inherited from Hocon::Impl::ConfigString

#value

Attributes included from AbstractConfigValue

#origin

Instance Method Summary collapse

Methods inherited from Hocon::Impl::ConfigString

#render_value_to_sb, #transform_to_string, #unwrapped, #value_type, #was_quoted?

Methods included from AbstractConfigValue

#==, #at_key, #at_key_with_origin, #at_path, #at_path_with_origin, #can_equal, #construct_delayed_merge, #delay_merge, has_descendant_in_list?, #hash, #ignores_fallbacks?, indent, #inspect, #merged_stack_with_non_object, #merged_stack_with_object, #merged_stack_with_the_unmergeable, #merged_with_non_object, #merged_with_object, #merged_with_the_unmergeable, #relativized, #render, #render_to_sb, #render_value_to_sb, replace_child_in_list, #require_not_ignoring_fallbacks, #resolve_status, #resolve_substitutions, #to_fallback_value, #to_s, #transform_to_string, #with_fallback, #with_fallbacks_ignored, #with_origin

Methods included from ConfigValue

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

Methods included from ConfigMergeable

#with_fallback

Constructor Details

#initialize(origin, value) ⇒ Unquoted

Returns a new instance of Unquoted.



42
43
44
# File 'lib/hocon/impl/config_string.rb', line 42

def initialize(origin, value)
  super(origin, value)
end

Instance Method Details

#new_copy(origin) ⇒ Object



46
47
48
# File 'lib/hocon/impl/config_string.rb', line 46

def new_copy(origin)
  self.class.new(origin, @value)
end

#write_replaceObject



50
51
52
# File 'lib/hocon/impl/config_string.rb', line 50

def write_replace
  Hocon::Impl::SerializedConfigValue.new(self)
end