mirror of
https://github.com/inspec/inspec
synced 2025-01-24 19:05:27 +00:00
10 lines
214 B
Ruby
10 lines
214 B
Ruby
# encoding: utf-8
|
|
|
|
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
|