Class: Hocon::Impl::ResolveResult
- Inherits:
-
Object
- Object
- Hocon::Impl::ResolveResult
- Defined in:
- lib/hocon/impl/resolve_result.rb
Overview
value is allowed to be null
Constant Summary collapse
- ConfigBugOrBrokenError =
Hocon::ConfigError::ConfigBugOrBrokenError
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #as_object_result ⇒ Object
- #as_value_result ⇒ Object
-
#initialize(context, value) ⇒ ResolveResult
constructor
A new instance of ResolveResult.
- #pop_trace ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(context, value) ⇒ ResolveResult
Returns a new instance of ResolveResult.
12 13 14 15 |
# File 'lib/hocon/impl/resolve_result.rb', line 12 def initialize(context, value) @context = context @value = value end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
10 11 12 |
# File 'lib/hocon/impl/resolve_result.rb', line 10 def context @context end |
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/hocon/impl/resolve_result.rb', line 10 def value @value end |
Class Method Details
.make(context, value) ⇒ Object
17 18 19 |
# File 'lib/hocon/impl/resolve_result.rb', line 17 def self.make(context, value) self.new(context, value) end |
Instance Method Details
#as_object_result ⇒ Object
21 22 23 24 25 26 |
# File 'lib/hocon/impl/resolve_result.rb', line 21 def as_object_result unless @value.is_a?(Hocon::Impl::AbstractConfigObject) raise ConfigBugOrBrokenError.new("Expecting a resolve result to be an object, but it was #{@value}") end self end |
#as_value_result ⇒ Object
28 29 30 |
# File 'lib/hocon/impl/resolve_result.rb', line 28 def as_value_result self end |
#pop_trace ⇒ Object
32 33 34 |
# File 'lib/hocon/impl/resolve_result.rb', line 32 def pop_trace self.class.make(@context.pop_trace, value) end |
#to_s ⇒ Object
36 37 38 |
# File 'lib/hocon/impl/resolve_result.rb', line 36 def to_s "ResolveResult(#{@value})" end |