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



220
221
222
223
224
225
226
227
228
229
# File 'lib/moped/node.rb', line 220

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