Method: Moped::Uri#initialize

Defined in:
lib/moped/uri.rb

#initialize(string) ⇒ Uri

Create the new uri from the provided string.

Examples:

Create the new uri.

MongoUri.new(uri)

Parameters:

  • string (String)

    The uri string.

Since:

  • 1.3.0



108
109
110
111
# File 'lib/moped/uri.rb', line 108

def initialize(string)
  @match = string.match(URI)
  invalid_uri!(string) unless @match
end