Skip to content

Instantly share code, notes, and snippets.

@hunner
Created November 8, 2011 00:47
Show Gist options
  • Save hunner/1346685 to your computer and use it in GitHub Desktop.
Save hunner/1346685 to your computer and use it in GitHub Desktop.
Simple keys() function for puppet
# <module>/lib/puppet/parser/functions/keys.rb
Puppet::Parser::Functions::newfunction(:keys, :type => :rvalue) do |args|
args.collect { |h| h.keys if h.is_a?(Hash) }.flatten.compact
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment