Class: PuppetX::Stdlib::TomlDumper

Inherits:
Object
  • Object
show all
Defined in:
vendor_modules/stdlib/lib/puppet_x/stdlib/toml_dumper.rb

Overview

The Dumper class was blindly copied from github.com/emancu/toml-rb/blob/v2.0.1/lib/toml-rb/dumper.rb This allows us to use the `to_toml` function as a `Deferred` function because the `toml-rb` gem is usually installed on the agent and the `Deferred` function gets evaluated before the catalog gets applied. This makes it in most scenarios impossible to install the gem before it is used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ TomlDumper

Returns a new instance of TomlDumper.



32
33
34
35
36
# File 'vendor_modules/stdlib/lib/puppet_x/stdlib/toml_dumper.rb', line 32

def initialize(hash)
  @toml_str = ''

  visit(hash, [])
end

Instance Attribute Details

#toml_strObject (readonly)

Returns the value of attribute toml_str.



30
31
32
# File 'vendor_modules/stdlib/lib/puppet_x/stdlib/toml_dumper.rb', line 30

def toml_str
  @toml_str
end