Method: Puppet::Pops::Serialization::ToDataConverter.convert

Defined in:
lib/puppet/pops/serialization/to_data_converter.rb

.convert(value, options = EMPTY_HASH) ⇒ Data

Convert the given value according to the given options and return the result of the conversion

Parameters:

  • value (Object)

    the value to convert

  • options (Symbol => <Boolean,String>) (defaults to: EMPTY_HASH)

    options hash

Options Hash (options):

  • :rich_data (Boolean)

    true if rich data is enabled

  • :local_reference (Boolean)

    use local references instead of duplicating complex entries

  • :type_by_reference (Boolean)

    true if Object types are converted to references rather than embedded.

  • :symbol_as_string (Boolean)

    true if Symbols should be converted to strings (with type loss)

  • :message_prefix (String)

    String to prepend to in warnings and errors

Returns:

  • (Data)

    the processed result. An object assignable to Data.



23
24
25
# File 'lib/puppet/pops/serialization/to_data_converter.rb', line 23

def self.convert(value, options = EMPTY_HASH)
  new(options).convert(value)
end