summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/is_numeric.rb
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-07-28 21:03:33 +0100
committerKen Barber <ken@bob.sh>2011-07-28 21:03:33 +0100
commit313df566bf5cfcbef73fc8182ccb07ddf2f13feb (patch)
tree787e71d3b3f844add2c691f669bfa126ccff49a3 /lib/puppet/parser/functions/is_numeric.rb
parent635ed82e5cae38b0ba82098c340cbeed70d483c3 (diff)
(#2) unstub is_numeric function.
Diffstat (limited to 'lib/puppet/parser/functions/is_numeric.rb')
-rw-r--r--lib/puppet/parser/functions/is_numeric.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/is_numeric.rb b/lib/puppet/parser/functions/is_numeric.rb
index 96e8674..c2c0fb5 100644
--- a/lib/puppet/parser/functions/is_numeric.rb
+++ b/lib/puppet/parser/functions/is_numeric.rb
@@ -12,6 +12,14 @@ module Puppet::Parser::Functions
"given #{arguments.size} for 1")
end
+ value = arguments[0]
+
+ if value == value.to_f.to_s or value == value.to_i.to_s then
+ return true
+ else
+ return false
+ end
+
end
end