Method: Moped::Node#initialize

Defined in:
lib/moped/node.rb

#initialize(address, options = {}) ⇒ Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creat the new node.

Examples:

Create the new node.

Node.new("127.0.0.1:27017")

Parameters:

  • address (String)

    The location of the server node.

  • options (Hash) (defaults to: {})

    Additional options for the node (ssl)

Since:

  • 1.0.0



243
244
245
246
247
248
249
250
251
252
# File 'lib/moped/node.rb', line 243

def initialize(address, options = {})
  @address = address
  @options = options
  @timeout = options[:timeout] || 5
  @down_at = nil
  @refreshed_at = nil
  @primary = nil
  @secondary = nil
  resolve_address
end