Class: Hocon::Impl::ConfigString

Inherits:
Object
  • Object
show all
Includes:
AbstractConfigValue
Defined in:
lib/hocon/impl/config_string.rb

Direct Known Subclasses

Quoted, Unquoted

Defined Under Namespace

Classes: Quoted, Unquoted

Constant Summary collapse

ConfigImplUtil =
Hocon::Impl::ConfigImplUtil

Constants included from AbstractConfigValue

AbstractConfigValue::ConfigBugOrBrokenError, AbstractConfigValue::ResolveStatus

Instance Attribute Summary collapse

Attributes included from AbstractConfigValue

#origin

Instance Method Summary collapse

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, #new_copy, #relativized, #render, #render_to_sb, replace_child_in_list, #require_not_ignoring_fallbacks, #resolve_status, #resolve_substitutions, #to_fallback_value, #to_s, #with_fallback, #with_fallbacks_ignored, #with_origin

Methods included from ConfigValue

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

Methods included from ConfigMergeable

#with_fallback

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13
14
15
# File 'lib/hocon/impl/config_string.rb', line 13

def value
  @value
end

Instance Method Details

#render_value_to_sb(sb, indent_size, at_root, options) ⇒ Object



71
72
73
74
75
76
77
# File 'lib/hocon/impl/config_string.rb', line 71

def render_value_to_sb(sb, indent_size, at_root, options)
  if options.json?
    sb << ConfigImplUtil.render_json_string(@value)
  else
    sb << ConfigImplUtil.render_string_unquoted_if_possible(@value)
  end
end

#transform_to_stringObject



67
68
69
# File 'lib/hocon/impl/config_string.rb', line 67

def transform_to_string
  @value
end

#unwrappedObject



63
64
65
# File 'lib/hocon/impl/config_string.rb', line 63

def unwrapped
  @value
end

#value_typeObject



59
60
61
# File 'lib/hocon/impl/config_string.rb', line 59

def value_type
  Hocon::ConfigValueType::STRING
end

#was_quoted?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/hocon/impl/config_string.rb', line 55

def was_quoted?
  self.is_a?(Quoted)
end