Skip to content

Commit d1f70c9

Browse files
committed
Merge pull request #89 from sdalu/patch-1
Adding Net::LDAP::Entry#first
2 parents a1c98d8 + 01015aa commit d1f70c9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/net/ldap/entry.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ def [](name)
113113
@myhash[name] || []
114114
end
115115

116+
##
117+
# Read the first value for the provided attribute. The attribute name
118+
# is canonicalized prior to reading. Returns nil if the attribute does
119+
# not exist.
120+
def first(name)
121+
self[name].first
122+
end
123+
116124
##
117125
# Returns the first distinguished name (dn) of the Entry as a \String.
118126
def dn

0 commit comments

Comments
 (0)