Skip to content

Commit e6cccef

Browse files
author
blackhedd
committed
added clarifying documentation parameters to #bind.
1 parent b828ff5 commit e6cccef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/net/ldap.rb

+17
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,23 @@ def search args = {}
709709
# p ldap.get_operation_result
710710
# end
711711
#
712+
# Here's a more succinct example which does exactly the same thing, but
713+
# collects all the required parameters into arguments:
714+
#
715+
# require 'net/ldap'
716+
# ldap = Net::LDAP.new( :host=>your_server_ip_address, :port=>389 )
717+
# if ldap.bind( :method=>:simple, :username=>your_user_name, :password=>your_user_password )
718+
# # authentication succeeded
719+
# else
720+
# # authentication failed
721+
# p ldap.get_operation_result
722+
# end
723+
#
724+
# You don't need to pass a user-password as a String object to bind. You can
725+
# also pass a Ruby Proc object which returns a string. This will cause bind to
726+
# execute the Proc (which might then solicit input from a user with console display
727+
# suppressed). The String value returned from the Proc is used as the password.
728+
#
712729
# You don't have to create a new instance of Net::LDAP every time
713730
# you perform a binding in this way. If you prefer, you can cache the Net::LDAP object
714731
# and re-use it to perform subsequent bindings, <i>provided</i> you call

0 commit comments

Comments
 (0)