Puppet Function: wildfly::objectify

Defined in:
functions/objectify.pp
Function type:
Puppet Language

Overview

wildfly::objectify(Array[Variant[String, Hash]] $elements)Hash[Hash, Hash]

Converts a LIST of STRINGs and OBJECTs into an OBJECT of OBJECTs.

Parameters:

  • elements (Array[Variant[String, Hash]])

    LIST of STRINGs or OBJECTS to be converted.

Returns:

  • (Hash[Hash, Hash])

    returns a Hash of OBJECTs.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'functions/objectify.pp', line 5

function wildfly::objectify(Array[Variant[String, Hash]] $elements) {

  $objectified = $elements.map |$element| {

    if $element.is_a(String) {
      [$element, {}]
    } else {
      $element.map |$key, $value| { [$key, $value] }
    }

  }

  hash($objectified)
}