Class: Hocon::ConfigUtil
- Inherits:
-
Object
- Object
- Hocon::ConfigUtil
- Defined in:
- lib/hocon/config_util.rb
Overview
Contains static utility methods
Class Method Summary collapse
-
.join_path(*elements) ⇒ Object
Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period.
-
.join_path_from_list(elements) ⇒ Object
Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period.
-
.quote_string(string) ⇒ Object
Quotes and escapes a string, as in the JSON specification.
-
.split_path(path) ⇒ Object
Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements.
Class Method Details
.join_path(*elements) ⇒ Object
Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a Config, while individual path elements are usable with a ConfigObject. <p> See the overview documentation for Config for more detail on path expressions vs. keys.
32 33 34 |
# File 'lib/hocon/config_util.rb', line 32 def self.join_path(*elements) Hocon::Impl::ConfigImplUtil.join_path(*elements) end |
.join_path_from_list(elements) ⇒ Object
Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with a Config, while individual path elements are usable with a ConfigObject. <p> See the overview documentation for Config for more detail on path expressions vs. keys.
51 52 53 |
# File 'lib/hocon/config_util.rb', line 51 def self.join_path_from_list(elements) self.join_path(*elements) end |
.quote_string(string) ⇒ Object
Quotes and escapes a string, as in the JSON specification.
13 14 15 |
# File 'lib/hocon/config_util.rb', line 13 def self.quote_string(string) Hocon::Impl::ConfigImplUtil.render_json_string(string) end |
.split_path(path) ⇒ Object
Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements. A path expression is usable with a Config, while individual path elements are usable with a ConfigObject. <p> See the overview documentation for Config for more detail on path expressions vs. keys.
70 71 72 |
# File 'lib/hocon/config_util.rb', line 70 def self.split_path(path) Hocon::Impl::ConfigImplUtil.split_path(path) end |