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.



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

#commentsObject

Returns the value of attribute comments.



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

def comments
  @comments
end

#formattedObject

Returns the value of attribute formatted.



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

def formatted
  @formatted
end

#jsonObject

Returns the value of attribute json.



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

def json
  @json
end

#origin_commentsObject

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

.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



45
46
47
# File 'lib/hocon/config_render_options.rb', line 45

def self.concise
  Hocon::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



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

Returns:

  • (Boolean)


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

def comments?
  @comments
end

#formatted?Boolean

Returns:

  • (Boolean)


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

def formatted?
  @formatted
end

#json?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/hocon/config_render_options.rb', line 24

def json?
  @json
end

#origin_comments?Boolean

Returns:

  • (Boolean)


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

def origin_comments?
  @origin_comments
end