From fe40fa1ef9d168e03624acefcd5d72c7dd588f0b Mon Sep 17 00:00:00 2001 From: blackhedd Date: Mon, 15 May 2006 18:33:01 +0000 Subject: [PATCH] improved behavior of setting attributes in entries --- lib/net/ldap/entry.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/net/ldap/entry.rb b/lib/net/ldap/entry.rb index f5354de..c74fa1d 100644 --- a/lib/net/ldap/entry.rb +++ b/lib/net/ldap/entry.rb @@ -143,11 +143,19 @@ class LDAP s = args[0] if attribute_names.include?(s) self[s] + elsif s.to_s[-1] == 61 and s.to_s.length > 1 + value = args[1] or raise RuntimeError.new( "unable to set value" ) + value = [value] unless value.is_a?(Array) + name = s.to_s[0..-2].intern + self[name] = value else raise NoMethodError.new( "undefined method '#{s}'" ) end end + def write + end + end # class Entry