Class: Hocon::ConfigRenderOptions
- Inherits:
-
Object
- Object
- Hocon::ConfigRenderOptions
- Defined in:
- lib/hocon/config_render_options.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#formatted ⇒ Object
Returns the value of attribute formatted.
-
#json ⇒ Object
Returns the value of attribute json.
-
#key_value_separator ⇒ Object
Returns the value of attribute key_value_separator.
-
#origin_comments ⇒ Object
Returns the value of attribute origin_comments.
Class Method Summary collapse
-
.concise ⇒ Object
Returns concise render options (no whitespace or comments).
-
.defaults ⇒ Object
Returns the default render options which are verbose (commented and formatted).
Instance Method Summary collapse
- #comments? ⇒ Boolean
- #formatted? ⇒ Boolean
-
#initialize(origin_comments, comments, formatted, json, key_value_separator = :equals) ⇒ ConfigRenderOptions
constructor
A new instance of ConfigRenderOptions.
- #json? ⇒ Boolean
- #origin_comments? ⇒ Boolean
Constructor Details
#initialize(origin_comments, comments, formatted, json, key_value_separator = :equals) ⇒ ConfigRenderOptions
Returns a new instance of ConfigRenderOptions.
6 7 8 9 10 11 12 |
# File 'lib/hocon/config_render_options.rb', line 6 def initialize(origin_comments, comments, formatted, json, key_value_separator=:equals) @origin_comments = origin_comments @comments = comments @formatted = formatted @json = json @key_value_separator = key_value_separator end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
14 15 16 |
# File 'lib/hocon/config_render_options.rb', line 14 def comments @comments end |
#formatted ⇒ Object
Returns the value of attribute formatted.
14 15 16 |
# File 'lib/hocon/config_render_options.rb', line 14 def formatted @formatted end |
#json ⇒ Object
Returns the value of attribute json.
14 15 16 |
# File 'lib/hocon/config_render_options.rb', line 14 def json @json end |
#key_value_separator ⇒ Object
Returns the value of attribute key_value_separator.
14 15 16 |
# File 'lib/hocon/config_render_options.rb', line 14 def key_value_separator @key_value_separator end |
#origin_comments ⇒ Object
Returns the value of attribute origin_comments.
14 15 16 |
# File 'lib/hocon/config_render_options.rb', line 14 def origin_comments @origin_comments end |
Class Method Details
.concise ⇒ Object
Returns concise render options (no whitespace or comments). For a resolved Config, the concise rendering will be valid JSON.
46 47 48 |
# File 'lib/hocon/config_render_options.rb', line 46 def self.concise Hocon::ConfigRenderOptions.new(false, false, false, true) end |
.defaults ⇒ Object
Returns the default render options which are verbose (commented and formatted). See ConfigRenderOptions#concise for stripped-down options. This rendering will not be valid JSON since it has comments.
36 37 38 |
# File 'lib/hocon/config_render_options.rb', line 36 def self.defaults Hocon::ConfigRenderOptions.new(true, true, true, true) end |
Instance Method Details
#comments? ⇒ Boolean
19 20 21 |
# File 'lib/hocon/config_render_options.rb', line 19 def comments? @comments end |
#formatted? ⇒ Boolean
22 23 24 |
# File 'lib/hocon/config_render_options.rb', line 22 def formatted? @formatted end |
#json? ⇒ Boolean
25 26 27 |
# File 'lib/hocon/config_render_options.rb', line 25 def json? @json end |
#origin_comments? ⇒ Boolean
16 17 18 |
# File 'lib/hocon/config_render_options.rb', line 16 def origin_comments? @origin_comments end |