def refresh
      if address.resolve(self)
        begin
          @refreshed_at = Time.now
          configure(command("admin", ismaster: 1))
          if !primary? && executing?(:ensure_primary)
            raise Errors::ReplicaSetReconfigured.new("#{inspect} is no longer the primary node.", {})
          elsif !messagable?
            # not primary or secondary so mark it as down, since it's probably
            # a recovering node withing the replica set
            down!
          end
        rescue Timeout::Error
          down!
        end
      end
    end
def refresh
      if address.resolve(self)
        begin
          @refreshed_at = Time.now
          configure(command("admin", ismaster: 1))
          if !primary? && executing?(:ensure_primary)
            raise Errors::ReplicaSetReconfigured.new("#{inspect} is no longer the primary node.", {})
          elsif !messagable?
            # not primary or secondary so mark it as down, since it's probably
            # a recovering node withing the replica set
            down!
          end
        rescue Timeout::Error
          down!
        end
      end
    end
Refresh information about the node, such as it's status in the replica
 set and it's known peers.

 @example Refresh the node.
   node.refresh

 @raise [ ConnectionFailure ] If the node cannot be reached.

 @raise [ ReplicaSetReconfigured ] If the node is no longer a primary node and
   refresh was called within an +#ensure_primary+ block.

 @return [ nil ] nil.

 @since 1.0.0