Return PDU instead of result code

This commit is contained in:
Michael Baker 2011-11-29 22:01:34 +00:00
parent 63db8c836a
commit 2763040162
4 changed files with 74 additions and 30 deletions

View file

@ -112,6 +112,10 @@ class Net::LDAP::PDU
@ldap_result || {}
end
def error_message
result[:errorMessage] || ""
end
##
# This returns an LDAP result code taken from the PDU, but it will be nil
# if there wasn't a result code. That can easily happen depending on the
@ -120,6 +124,10 @@ class Net::LDAP::PDU
@ldap_result and @ldap_result[code]
end
def status
result_code == 0 ? :success : :failure
end
##
# Return serverSaslCreds, which are only present in BindResponse packets.
#--