mirror of
https://github.com/inspec/inspec
synced 2024-12-11 22:02:47 +00:00
12 lines
265 B
Ruby
12 lines
265 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 =~ /^\d+$/
|
|
val
|
|
end
|
|
end
|