Class: Hocon::Impl::SimpleIncluder::RelativeNameSource

Inherits:
NameSource
  • Object
show all
Defined in:
lib/hocon/impl/simple_includer.rb

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ RelativeNameSource

Returns a new instance of RelativeNameSource.



110
111
112
# File 'lib/hocon/impl/simple_includer.rb', line 110

def initialize(context)
  @context = context
end

Instance Method Details

#name_to_parseable(name, options) ⇒ Object



114
115
116
117
118
119
120
121
122
# File 'lib/hocon/impl/simple_includer.rb', line 114

def name_to_parseable(name, options)
  p = @context.relative_to(name)
  if p.nil?
    # avoid returning nil
    Hocon::Impl::Parseable.new_not_found(name, "include was not found: '#{name}'", options)
  else
    p
  end
end