diff --git a/lib/net/ldap/entry.rb b/lib/net/ldap/entry.rb index 616ffe7f..9ab4bb6d 100644 --- a/lib/net/ldap/entry.rb +++ b/lib/net/ldap/entry.rb @@ -113,6 +113,14 @@ def [](name) @myhash[name] || [] end + ## + # Read the first value for the provided attribute. The attribute name + # is canonicalized prior to reading. Returns nil if the attribute does + # not exist. + def first(name) + self[name].first + end + ## # Returns the first distinguished name (dn) of the Entry as a \String. def dn