def convert_if_needed(value)  #:nodoc:
      if value =~ /^[+-]?\d+\.?\d*$/ # float
        value = value.to_f
      elsif value =~ /^[+-]?\d+$/ # int
        value = value.to_i
      else
        value
      end
    end
def convert_if_needed(value)  #:nodoc:
      if value =~ /^[+-]?\d+\.?\d*$/ # float
        value = value.to_f
      elsif value =~ /^[+-]?\d+$/ # int
        value = value.to_i
      else
        value
      end
    end
converts strings if it is float and int numbers.
 @example
   convert_if_needed('10') # => 10
   convert_if_needed('0.1') # => 0.1
   convert_if_needed('string') # => 'string'
 @param [String] value string
 @return [Float, Integer, String] return converted value.