We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb4b2ba commit 493b81bCopy full SHA for 493b81b
lib/net/ldap/entry.rb
@@ -128,6 +128,22 @@ def each
128
alias_method :each_attribute, :each
129
130
131
+
132
+ # Converts the Entry to a String, representing the
133
+ # Entry's attributes in LDIF format.
134
+ def to_ldif
135
+ ary = []
136
+ ary << "dn: #{dn}\n"
137
+ each_attribute do |k,v|
138
+ v.each {|v1|
139
+ ary << "#{k}: #{v1}\n" unless k == :dn
140
+ }
141
+ end
142
+ ary << "\n"
143
+ ary.join
144
145
146
147
#--
148
# Convenience method to convert unknown method names
149
# to attribute references. Of course the method name
0 commit comments