lib/mongo/uri/options_mapper.rb
def convert_max_staleness(name, value)
        if /\A-?\d+\z/ =~ value
          int = value.to_i

          if int == -1
            int = nil
          end

          if int && (int >= 0 && int < 90 || int < 0)
            log_warn("max staleness should be either 0 or greater than 90: #{value}")
            int = nil
          end

          return int
        end

        log_warn("Invalid max staleness value: #{value}")
        nil
      end
# Parses the max staleness value, which must be either "0" or an integer
# greater or equal to 90.
#
# @param [ String ] name Name of the URI option being processed.
# @param value [ String ] The max staleness string.
#
# @return [ Integer | nil ] The max staleness integer parsed out if it is valid, otherwise nil
#   (and a warning will be logged).
Parses the max staleness value, which must be either "0" or an integer
greater or equal to 90.
Parses the max staleness value which must be either " 0 " or an integer greater or equal to 90 .
def convert_max_staleness(name, value)
        if /\A-?\d+\z/ =~ value
          int = value.to_i
          if int == -1
            int = nil
          end
          if int && (int >= 0 && int < 90 || int < 0)
            log_warn("max staleness should be either 0 or greater than 90: #{value}")
            int = nil
          end
          return int
        end
        log_warn("Invalid max staleness value: #{value}")
        nil
      end
def convert_max_staleness ( name , value ) if / \A -? \d + \z / =~ value int = value . to_i if int == - 1 int = nil end if int && ( int >= 0 && int < 90 || int < 0 ) log_warn ( "max staleness should be either 0 or greater than 90: #{value}" ) int = nil end return int end log_warn ( "Invalid max staleness value: #{value}" ) nil end
Parses the max staleness value, which must be either "0" or an integer
greater or equal to 90.
Parses the max staleness value which must be either " 0 " or an integer greater or equal to 90 .
The max staleness integer parsed out if it is valid, otherwise nil (and a warning will be logged).
The max staleness integer parsed out if it is valid otherwise nil ( and a warning will be logged ) .
 Integer | nil 
name
value
The max staleness string.
The max staleness string .
name Name of the URI option being processed.
name Name of the URI option being processed .