Class: Hocon::Impl::ConfigDouble

Inherits:
ConfigNumber show all
Defined in:
lib/hocon/impl/config_double.rb

Constant Summary

Constants included from AbstractConfigValue

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

Instance Attribute Summary collapse

Attributes inherited from ConfigNumber

#original_text

Attributes included from AbstractConfigValue

#origin

Instance Method Summary collapse

Methods inherited from ConfigNumber

#==, #can_equal, #hash, #int_value_range_checked, new_number

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, #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

Constructor Details

#initialize(origin, value, original_text) ⇒ ConfigDouble

Returns a new instance of ConfigDouble.



7
8
9
10
# File 'lib/hocon/impl/config_double.rb', line 7

def initialize(origin, value, original_text)
  super(origin, original_text)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12
13
14
# File 'lib/hocon/impl/config_double.rb', line 12

def value
  @value
end

Instance Method Details

#double_valueObject



35
36
37
# File 'lib/hocon/impl/config_double.rb', line 35

def double_value
  @value
end

#long_valueObject



31
32
33
# File 'lib/hocon/impl/config_double.rb', line 31

def long_value
  @value.to_i
end

#new_copy(origin) ⇒ Object



39
40
41
# File 'lib/hocon/impl/config_double.rb', line 39

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

#transform_to_stringObject



22
23
24
25
26
27
28
29
# File 'lib/hocon/impl/config_double.rb', line 22

def transform_to_string
  s = super
  if s.nil?
    @value.to_s
  else
    s
  end
end

#unwrappedObject



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

def unwrapped
  @value
end

#value_typeObject



14
15
16
# File 'lib/hocon/impl/config_double.rb', line 14

def value_type
  Hocon::ConfigValueType::NUMBER
end