puppetlabs/puppetlabs-stdlib — pull request #130 by jhoblitt (2013-02-14 19:08:09+00:00)
Title: (#19272) Add has_element() function

It is exceptionally difficult to determine if an array contains an element matching a specific value without an iteration or loop construct.

This function is the Puppet equivalent of Array.includes?(foo) in Ruby. The implementation is a verbatim copy of has_key() with the minor modifications needed to support arrays instead of hashes.