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.
-
#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) ⇒ ConfigRenderOptions
constructor
A new instance of ConfigRenderOptions.
- #json? ⇒ Boolean
- #origin_comments? ⇒ Boolean
Constructor Details
#initialize(origin_comments, comments, formatted, json) ⇒ ConfigRenderOptions
Returns a new instance of ConfigRenderOptions.
6 7 8 9 10 11 |
# File 'lib/hocon/config_render_options.rb', line 6 def initialize(origin_comments, comments, formatted, json) @origin_comments = origin_comments @comments = comments @formatted = formatted @json = json end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
13 14 15 |
# File 'lib/hocon/config_render_options.rb', line 13 def comments @comments end |
#formatted ⇒ Object
Returns the value of attribute formatted.
13 14 15 |
# File 'lib/hocon/config_render_options.rb', line 13 def formatted @formatted end |
#json ⇒ Object
Returns the value of attribute json.
13 14 15 |
# File 'lib/hocon/config_render_options.rb', line 13 def json @json end |
#origin_comments ⇒ Object
Returns the value of attribute origin_comments.
13 14 15 |
# File 'lib/hocon/config_render_options.rb', line 13 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.
45 46 47 |
# File 'lib/hocon/config_render_options.rb', line 45 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.
35 36 37 |
# File 'lib/hocon/config_render_options.rb', line 35 def self.defaults Hocon::ConfigRenderOptions.new(true, true, true, true) end |
Instance Method Details
#comments? ⇒ Boolean
18 19 20 |
# File 'lib/hocon/config_render_options.rb', line 18 def comments? @comments end |
#formatted? ⇒ Boolean
21 22 23 |
# File 'lib/hocon/config_render_options.rb', line 21 def formatted? @formatted end |
#json? ⇒ Boolean
24 25 26 |
# File 'lib/hocon/config_render_options.rb', line 24 def json? @json end |
#origin_comments? ⇒ Boolean
15 16 17 |
# File 'lib/hocon/config_render_options.rb', line 15 def origin_comments? @origin_comments end |