/[adm]/puppet/modules/mga-common/lib/puppet/parser/functions/hash_keys.rb
ViewVC logotype

Contents of /puppet/modules/mga-common/lib/puppet/parser/functions/hash_keys.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3121 - (show annotations) (download)
Thu May 23 15:04:45 2013 UTC (10 years, 11 months ago) by boklm
File size: 234 byte(s)
mga-common: add hash_keys function

This function takes a hash as argument and return the hash keys as a
list.
1 module Puppet::Parser::Functions
2 newfunction(:hash_keys, :type => :rvalue) do |args|
3 unless args[0].is_a?(Hash)
4 Puppet.warning "hash_keys takes one argument, the input hash"
5 nil
6 else
7 args[0].keys
8 end
9 end
10 end

  ViewVC Help
Powered by ViewVC 1.1.30