Skip to content

Commit 389fcc3

Browse files
author
Tom Maher
committed
clarifying comment on use of URI.parse()
1 parent 48610ae commit 389fcc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/net/ldap.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ def self.result2string(code) #:nodoc:
544544
# parameters in the object. That's why Net::LDAP.new doesn't throw
545545
# cert validation errors itself; #bind does instead.
546546
def initialize(args = {})
547+
# URI.parse('') returns a valid URI object, but with all its
548+
# attributes set to nil. This is convenient for chainging the '||'
547549
@uri = URI.parse(args[:uri] || '')
548550

549551
unless ['ldaps', 'ldap'].include? @uri.scheme

0 commit comments

Comments
 (0)