Module: Converter
- Included in:
- Inspec::Resources::EtcGroup, Inspec::Resources::InterfaceInfo, Inspec::Resources::UserInfo
- Defined in:
- lib/utils/convert.rb
Overview
author: Dominik Richter author: Christoph Hartmann
Instance Method Summary collapse
-
#convert_to_i(val) ⇒ Object
convert the value to an integer if we have numbers only otherwise we return the string.
Instance Method Details
#convert_to_i(val) ⇒ Object
convert the value to an integer if we have numbers only otherwise we return the string
8 9 10 11 |
# File 'lib/utils/convert.rb', line 8 def convert_to_i(val) val = val.to_i if val =~ /^\d+$/ val end |