Skip to content

Commit fe40fa1

Browse files
author
blackhedd
committed
improved behavior of setting attributes in entries
1 parent 39ec12a commit fe40fa1

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
@@ -143,11 +143,19 @@ def method_missing *args, &block # :nodoc:
143143
s = args[0]
144144
if attribute_names.include?(s)
145145
self[s]
146+
elsif s.to_s[-1] == 61 and s.to_s.length > 1
147+
value = args[1] or raise RuntimeError.new( "unable to set value" )
148+
value = [value] unless value.is_a?(Array)
149+
name = s.to_s[0..-2].intern
150+
self[name] = value
146151
else
147152
raise NoMethodError.new( "undefined method '#{s}'" )
148153
end
149154
end
150155

156+
def write
157+
end
158+
151159
end # class Entry
152160

153161

0 commit comments

Comments
 (0)