Class: ROM::LDAP::LDIF::Importer Private

Inherits:
Object
  • Object
show all
Extended by:
Initializer
Defined in:
lib/rom/ldap/ldif/importer.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

LDIF to importable tuples.

Instance Method Summary collapse

Instance Method Details

#to_tuplesArray<Hash>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Examples:

>


[{
              :dn => "ou=users, dc=rom, dc=ldap",
             "ou" => "users",
    "objectClass" => "organizationalUnit"
}]


29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rom/ldap/ldif/importer.rb', line 29

def to_tuples
  dataset.map do |entry|
    next if entry.any? { |l| l.match?(/^version/) }

    abort 'update statements not allowed' if entry.any? { |l| l.match?(/^changetype/) }

    tuple = parse(entry)

    block_given? ? yield(tuple) : tuple
  end.compact
end