lib/mongo/uri/options_mapper.rb
def convert_ms(name, value)
        unless /\A-?\d+(\.\d+)?\z/ =~ value
          log_warn("Invalid ms value for #{name}: #{value}")
          return nil
        end

        if value[0] == '-'
          log_warn("#{name} cannot be a negative number")
          return nil
        end

        value.to_f / 1000
      end
# Ruby's convention is to provide timeouts in seconds, not milliseconds and
# to use fractions where more precision is necessary. The connection string
# options are always in MS so we provide an easy conversion type.
#
# @param [ String ] name Name of the URI option being processed.
# @param [ Integer ] value The millisecond value.
#
# @return [ Float ] The seconds value.
#
# @since 2.0.0
Ruby's convention is to provide timeouts in seconds, not milliseconds and
to use fractions where more precision is necessary. The connection string
options are always in MS so we provide an easy conversion type.
Ruby ' s convention is to provide timeouts in seconds not milliseconds and to use fractions where more precision is necessary . The connection string options are always in MS so we provide an easy conversion type .
def convert_ms(name, value)
        unless /\A-?\d+(\.\d+)?\z/ =~ value
          log_warn("Invalid ms value for #{name}: #{value}")
          return nil
        end
        if value[0] == '-'
          log_warn("#{name} cannot be a negative number")
          return nil
        end
        value.to_f / 1000
      end
def convert_ms ( name , value ) unless / \A -? \d +( \. \d +)? \z / =~ value log_warn ( "Invalid ms value for #{name}: #{value}" ) return nil end if value [ 0 ] == '-' log_warn ( "#{name} cannot be a negative number" ) return nil end value . to_f / 1000 end
Ruby's convention is to provide timeouts in seconds, not milliseconds and
to use fractions where more precision is necessary.
Ruby ' s convention is to provide timeouts in seconds not milliseconds and to use fractions where more precision is necessary .
The seconds value.
The seconds value .
 Float 
name
value
value The millisecond value.
value The millisecond value .
since
None