lib/mongo/uri/srv_protocol.rb
# Parses the TXT record options into a hash and adds the options to set of all URI options
# parsed.
#
# @param [ String ] string The concatenated TXT options.
#
# @return [ Hash ] The parsed TXT options.
#
# @raise [ Mongo::Error::InvalidTXTRecord ] If the TXT record does not fit the expected form
#   or the option specified is not a valid TXT option.
Parses the TXT record options into a hash and adds the options to set of all URI options
parsed.
Parses the TXT record options into a hash and adds the options to set of all URI options parsed .
def parse_txt_options!(string)
        string.split(INDIV_URI_OPTS_DELIM).reduce({}) do |txt_options, opt|
          raise Error::InvalidTXTRecord.new(INVALID_OPTS_VALUE_DELIM) unless opt.index(URI_OPTS_VALUE_DELIM)
          key, value = opt.split('=')
          unless VALID_TXT_OPTIONS.include?(key.downcase)
            msg = "TXT records can only specify the options [#{VALID_TXT_OPTIONS.join(', ')}]: #{string}"
            raise Error::InvalidTXTRecord.new(msg)
          end
          options_mapper.add_uri_option(key, value, txt_options)
          txt_options
        end
      end
def parse_txt_options! ( string ) string . split ( INDIV_URI_OPTS_DELIM ) . reduce ( { } ) do | txt_options , opt | raise Error :: InvalidTXTRecord . new ( INVALID_OPTS_VALUE_DELIM ) unless opt . index ( URI_OPTS_VALUE_DELIM ) key , value = opt . split ( '=' ) unless VALID_TXT_OPTIONS . include? ( key . downcase ) msg = "TXT records can only specify the options [#{VALID_TXT_OPTIONS.join(', ')}]: #{string}" raise Error :: InvalidTXTRecord . new ( msg ) end options_mapper . add_uri_option ( key , value , txt_options ) txt_options end end
Parses the TXT record options into a hash and adds the options to set of all URI options
parsed.
Parses the TXT record options into a hash and adds the options to set of all URI options parsed .
The parsed TXT options.
The parsed TXT options .
 Hash 
[ Mongo::Error::InvalidTXTRecord ] If the TXT record does not fit the expected form or the option specified is not a valid TXT option.
[ Mongo :: Error :: InvalidTXTRecord ] If the TXT record does not fit the expected form or the option specified is not a valid TXT option .
string
string The concatenated TXT options.
string The concatenated TXT options .