def base_64_credentials(credentials = {})
      creds = credentials.empty? ? @credentials : credentials

      encoded = Base64.encode64(creds[:username] + ':' + creds[:password])
      encoded.rstrip!
    end
def base_64_credentials(credentials = {})
      creds = credentials.empty? ? @credentials : credentials

      encoded = Base64.encode64(creds[:username] + ':' + creds[:password])
      encoded.rstrip!
    end
Encode the passed credentials (username/password) into a base64
 representation that can be used to generate a Http-Authentication header
 @param credentials [Hash{:username,:password}]
 @return [String] Base64 encoded result