Module: Hocon::ConfigIncludeContext
- Included in:
- Impl::SimpleIncludeContext
- Defined in:
- lib/hocon/config_include_context.rb
Overview
Context provided to a ConfigIncluder; this interface is only useful inside a ConfigIncluder implementation, and is not intended for apps to implement.
<p> Do not implement this interface; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.
Instance Method Summary collapse
-
#parse_options ⇒ Object
Parse options to use (if you use another method to get a ConfigParseable then use ConfigParseable#options() instead though).
-
#relative_to(filename) ⇒ Object
Tries to find a name relative to whatever is doing the including, for example in the same directory as the file doing the including.
Instance Method Details
#parse_options ⇒ Object
Parse options to use (if you use another method to get a ConfigParseable then use ConfigParseable#options() instead though).
46 47 48 |
# File 'lib/hocon/config_include_context.rb', line 46 def raise Hocon::ConfigError::ConfigBugOrBrokenError, "subclasses of `ConfigIncludeContext` must implement `parse_options` (#{self.class})" end |
#relative_to(filename) ⇒ Object
Tries to find a name relative to whatever is doing the including, for example in the same directory as the file doing the including. Returns null if it can’t meaningfully create a relative name. The returned parseable may not exist; this function is not required to do any IO, just compute what the name would be.
The passed-in filename has to be a complete name (with extension), not just a basename. (Include statements in config files are allowed to give just a basename.)
35 36 37 |
# File 'lib/hocon/config_include_context.rb', line 35 def relative_to(filename) raise Hocon::ConfigError::ConfigBugOrBrokenError, "subclasses of `ConfigIncludeContext` must implement `relative_to` (#{self.class})" end |