Sha256: 1b324d8461d3dc3324fb732381e71c7192ea84633d7a9cd0add3c8082050f9bf
Contents?: true
Size: 825 Bytes
Versions: 44
Compression:
Stored size: 825 Bytes
Contents
Puppet::Parser::Functions::newfunction( :dig, :type => :rvalue, :arity => -1, :doc => <<-DOC Returns a value for a sequence of given keys/indexes into a structure. This function is used to "dig into" a complex data structure by using a sequence of keys / indexes to access a value from which the next key/index is accessed recursively. The first encountered `undef` value or key stops the "dig" and `undef` is returned. An error is raised if an attempt is made to "dig" into something other than an `undef` (which immediately returns `undef`), an `Array` or a `Hash`. **Example:** Using `dig` ```puppet $data = {a => { b => [{x => 10, y => 20}, {x => 100, y => 200}]}} notice $data.dig(a, b, 1, x) ``` Would notice the value 100. * Since 4.5.0 DOC ) do |args| Puppet::Parser::Functions::Error.is4x('dig') end
Version data entries
44 entries across 44 versions & 2 rubygems