Class: Hocon::ConfigRenderOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/hocon/config_render_options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute comments to.



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

Parameters:

  • value

    the value to set the attribute formatted to.



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

Parameters:

  • value

    the value to set the attribute json to.



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

Parameters:

  • value

    the value to set the attribute origin_comments to.



10
11
12
# File 'lib/hocon/config_render_options.rb', line 10

def origin_comments=(value)
  @origin_comments = value
end

Class Method Details

.conciseObject

Returns concise render options (no whitespace or comments). For a resolved Config, the concise rendering will be valid JSON.

Returns:

  • the concise render options



42
43
44
# File 'lib/hocon/config_render_options.rb', line 42

def self.concise
  ConfigRenderOptions.new(false, false, false, true)
end

.defaultsObject

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.

Returns:

  • the default render options



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

Returns:

  • (Boolean)


15
16
17
# File 'lib/hocon/config_render_options.rb', line 15

def comments?
  @comments
end

#formatted?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/hocon/config_render_options.rb', line 18

def formatted?
  @formatted
end

#json?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/hocon/config_render_options.rb', line 21

def json?
  @json
end

#origin_comments?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/hocon/config_render_options.rb', line 12

def origin_comments?
  @origin_comments
end