Class Moped::Address
In: lib/moped/address.rb
Parent: Object

Encapsulates behaviour around addresses and resolving dns.

@since 2.0.0

Methods

new   resolve  

Attributes

host  [R]  @!attribute host
  @return [ String ] The host name.

@!attribute ip

  @return [ String ] The ip address.

@!attribute original

  @return [ String ] The original host name.

@!attribute port

  @return [ Integer ] The port.

@!attribute resolved

  @return [ String ] The full resolved address.
ip  [R]  @!attribute host
  @return [ String ] The host name.

@!attribute ip

  @return [ String ] The ip address.

@!attribute original

  @return [ String ] The original host name.

@!attribute port

  @return [ Integer ] The port.

@!attribute resolved

  @return [ String ] The full resolved address.
original  [R]  @!attribute host
  @return [ String ] The host name.

@!attribute ip

  @return [ String ] The ip address.

@!attribute original

  @return [ String ] The original host name.

@!attribute port

  @return [ Integer ] The port.

@!attribute resolved

  @return [ String ] The full resolved address.
port  [R]  @!attribute host
  @return [ String ] The host name.

@!attribute ip

  @return [ String ] The ip address.

@!attribute original

  @return [ String ] The original host name.

@!attribute port

  @return [ Integer ] The port.

@!attribute resolved

  @return [ String ] The full resolved address.
resolved  [R]  @!attribute host
  @return [ String ] The host name.

@!attribute ip

  @return [ String ] The ip address.

@!attribute original

  @return [ String ] The original host name.

@!attribute port

  @return [ Integer ] The port.

@!attribute resolved

  @return [ String ] The full resolved address.

Public Class methods

Instantiate the new address.

@example Instantiate the address.

  Moped::Address.new("localhost:27017")

@param [ String ] address The host:port pair as a string.

@since 2.0.0

Public Instance methods

Resolve the address for the provided node. If the address cannot be resolved the node will be flagged as down.

@example Resolve the address.

  address.resolve(node)

@param [ Node ] node The node to resolve for.

@return [ String ] The resolved address.

@since 2.0.0

[Validate]