def add(username, realm, password)
      raise DigestFileError, "Unable to add already existing user #{username} in realm #{realm}" if has_entry?(username, realm)

      new_entry = DigestEntry.new(username, realm, password)
      new_index = @lines.size
      @lines << new_entry.to_s
      @entries[new_entry.key] = { 'entry' => new_entry, 'line_index' => new_index }
      dirty!
      return nil
    end
def add(username, realm, password)
      raise DigestFileError, "Unable to add already existing user #{username} in realm #{realm}" if has_entry?(username, realm)

      new_entry = DigestEntry.new(username, realm, password)
      new_index = @lines.size
      @lines << new_entry.to_s
      @entries[new_entry.key] = { 'entry' => new_entry, 'line_index' => new_index }
      dirty!
      return nil
    end
Public: Add a new record to the file.

 username - the username of the entry
 realm    - the realm of the entry
 password - the password of the entry

 Examples

   digest_file.add("newuser", "realm", "password")
   digest_file.save!

 Returns nothing.
 Raises DigestFileError if the give username / realm already exists.