def apply_credentials(logins)
      unless credentials == logins
        logouts = credentials.keys - logins.keys
        logouts.each do |database|
          logout(database)
        end
        logins.each do |database, (username, password)|
          unless credentials[database] == [ username, password ]
            login(database, username, password)
          end
        end
        @original_credentials = credentials.dup
      end
      self
    end
def apply_credentials(logins)
      unless credentials == logins
        logouts = credentials.keys - logins.keys
        logouts.each do |database|
          logout(database)
        end
        logins.each do |database, (username, password)|
          unless credentials[database] == [ username, password ]
            login(database, username, password)
          end
        end
        @original_credentials = credentials.dup
      end
      self
    end
Apply authentication credentials.

 @example Apply the authentication credentials.
   node.apply_credentials({ "moped_test" => [ "user", "pass" ]})

 @param [ Hash ] credentials The authentication credentials in the form:
   { database_name: [ user, password ]}

 @return [ Object ] The authenticated object.

 @since 2.0.0