inspec/lib/utils/convert.rb
Christoph Hartmann 8fff2ee989 add author header
2015-10-06 18:55:44 +02:00

12 lines
269 B
Ruby

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann
module Converter
# convert the value to an integer if we have numbers only
# otherwise we return the string
def convert_to_i(val)
val = val.to_i if val.match(/^\d+$/)
val
end
end