Skip to content

Commit 6d51323

Browse files
committed
Make #auth_capable? public
This can be useful to users of the library, in the same way that `#capable?`, `#capabilities`, and `#capable_auth_types` are all useful. I suggest deprecating the specific mechanism predicate methods (`capable_plain_auth?`, `capable_login_auth?`, and `capable_cram_md5_auth?`), as they are all replaced by this.
1 parent c41e299 commit 6d51323

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/net/smtp.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,13 @@ def capable_cram_md5_auth?
316316
auth_capable?('CRAM-MD5')
317317
end
318318

319+
# Returns whether the server advertises support for the authentication type.
320+
# You cannot get valid result before opening SMTP session.
319321
def auth_capable?(type)
320322
return nil unless @capabilities
321323
return false unless @capabilities['AUTH']
322324
@capabilities['AUTH'].include?(type)
323325
end
324-
private :auth_capable?
325326

326327
# Returns supported authentication methods on this server.
327328
# You cannot get valid value before opening SMTP session.

0 commit comments

Comments
 (0)