summaryrefslogtreecommitdiff
path: root/values.rb
diff options
context:
space:
mode:
Diffstat (limited to 'values.rb')
-rw-r--r--values.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/values.rb b/values.rb
new file mode 100644
index 0000000..8e58184
--- /dev/null
+++ b/values.rb
@@ -0,0 +1,25 @@
+#
+# values.rb
+#
+
+module Puppet::Parser::Functions
+ newfunction(:values, :type => :rvalue, :doc => <<-EOS
+ EOS
+ ) do |arguments|
+
+ raise(Puppet::ParseError, "values(): Wrong number of arguments " +
+ "given (#{arguments.size} for 1)") if arguments.size < 1
+
+ hash = arguments[0]
+
+ if not hash.is_a?(Hash)
+ raise(Puppet::ParseError, 'values(): Requires a hash to work with')
+ end
+
+ result = hash.values
+
+ return result
+ end
+end
+
+# vim: set ts=2 sw=2 et :