Module: ActiveLdap::Operations::LDIF
- Defined in:
- lib/active_ldap/operations.rb
Instance Method Summary collapse
- #dump(options = {}) ⇒ Object
- #load(ldifs, options = {}) ⇒ Object
- #to_ldif(dn, attributes, options = {}) ⇒ Object
Instance Method Details
#dump(options = {}) ⇒ Object
296 297 298 299 300 301 302 303 304 |
# File 'lib/active_ldap/operations.rb', line 296 def dump(={}) ldifs = [] = {:base => base, :scope => scope}.merge() conn = [:connection] || connection conn.search() do |dn, attributes| ldifs << to_ldif(dn, attributes) end ldifs.join("\n") end |
#load(ldifs, options = {}) ⇒ Object
311 312 313 314 |
# File 'lib/active_ldap/operations.rb', line 311 def load(ldifs, ={}) conn = [:connection] || connection conn.load(ldifs) end |
#to_ldif(dn, attributes, options = {}) ⇒ Object
306 307 308 309 |
# File 'lib/active_ldap/operations.rb', line 306 def to_ldif(dn, attributes, ={}) conn = [:connection] || connection conn.to_ldif(dn, unnormalize_attributes(attributes)) end |