Class: PuppetX::Stdlib::TomlDumper
- Inherits:
-
Object
- Object
- PuppetX::Stdlib::TomlDumper
- Defined in:
- 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
-
#toml_str ⇒ Object
readonly
Returns the value of attribute toml_str.
Instance Method Summary collapse
-
#initialize(hash) ⇒ TomlDumper
constructor
A new instance of TomlDumper.
Constructor Details
#initialize(hash) ⇒ TomlDumper
Returns a new instance of TomlDumper.
31 32 33 34 35 |
# File 'lib/puppet_x/stdlib/toml_dumper.rb', line 31 def initialize(hash) @toml_str = '' visit(hash, []) end |
Instance Attribute Details
#toml_str ⇒ Object (readonly)
Returns the value of attribute toml_str.
29 30 31 |
# File 'lib/puppet_x/stdlib/toml_dumper.rb', line 29 def toml_str @toml_str end |