inspec/lib/utils/convert.rb
Miah Johnson 659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00

11 lines
247 B
Ruby

# 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 =~ /^\d+$/
val
end
end