Class: Hocon::ConfigRenderOptions
- Inherits:
-
Object
- Object
- Hocon::ConfigRenderOptions
- Defined in:
- lib/hocon/config_render_options.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
writeonly
Sets the attribute comments.
-
#formatted ⇒ Object
writeonly
Sets the attribute formatted.
-
#json ⇒ Object
writeonly
Sets the attribute json.
-
#origin_comments ⇒ Object
writeonly
Sets the 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.
3 4 5 6 7 8 |
# File 'lib/hocon/config_render_options.rb', line 3 def initialize(origin_comments, comments, formatted, json) @origin_comments = origin_comments @comments = comments @formatted = formatted @json = json end |
Instance Attribute Details
#comments=(value) ⇒ Object (writeonly)
Sets the attribute comments
10 11 12 |
# File 'lib/hocon/config_render_options.rb', line 10 def comments=(value) @comments = value end |
#formatted=(value) ⇒ Object (writeonly)
Sets the attribute formatted
10 11 12 |
# File 'lib/hocon/config_render_options.rb', line 10 def formatted=(value) @formatted = value end |
#json=(value) ⇒ Object (writeonly)
Sets the attribute json
10 11 12 |
# File 'lib/hocon/config_render_options.rb', line 10 def json=(value) @json = value end |
#origin_comments=(value) ⇒ Object (writeonly)
Sets the attribute origin_comments
10 11 12 |
# File 'lib/hocon/config_render_options.rb', line 10 def origin_comments=(value) @origin_comments = value 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.
42 43 44 |
# File 'lib/hocon/config_render_options.rb', line 42 def self.concise 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.
32 33 34 |
# File 'lib/hocon/config_render_options.rb', line 32 def self.defaults ConfigRenderOptions.new(true, true, true, true) end |
Instance Method Details
#comments? ⇒ Boolean
15 16 17 |
# File 'lib/hocon/config_render_options.rb', line 15 def comments? @comments end |
#formatted? ⇒ Boolean
18 19 20 |
# File 'lib/hocon/config_render_options.rb', line 18 def formatted? @formatted end |
#json? ⇒ Boolean
21 22 23 |
# File 'lib/hocon/config_render_options.rb', line 21 def json? @json end |
#origin_comments? ⇒ Boolean
12 13 14 |
# File 'lib/hocon/config_render_options.rb', line 12 def origin_comments? @origin_comments end |