class ROM::LDAP::Relation

Public Class Methods

associations() click to toggle source

@api public

# File lib/rom/ldap/relation.rb, line 101
def self.associations
  schema.associations
end

Public Instance Methods

assoc(name) click to toggle source

@return [Relation]

@api public

# File lib/rom/ldap/relation.rb, line 108
def assoc(name)
  associations[name].call
end
base() click to toggle source

Expose the search base currently in use.

@return [String] current base

@api public

# File lib/rom/ldap/relation.rb, line 87
def base
  dataset.opts[:base]
end
primary_key() click to toggle source

Fallsback to 'entrydn' operational value.

@return [Symbol]

@api public

# File lib/rom/ldap/relation.rb, line 72
def primary_key
  attribute = schema.find(&:primary_key?)

  if attribute
    attribute.alias || attribute.name
  else
    DEFAULT_PK
  end
end
to_filter() click to toggle source

Current dataset in LDAP filter format.

@return [String]

@api public

# File lib/rom/ldap/relation.rb, line 96
def to_filter
  dataset.opts[:filter]
end
transaction(opts = EMPTY_OPTS, &block) click to toggle source

LDAP Transactions (LDAPTXN) is an experimental RFC. The latest revision can be found at tools.ietf.org/rfc/rfc5805.txt

@see directory.fedoraproject.org/docs/389ds/design/ldap-transactions.html

@yield [t] Transaction

@return [Mixed]

@api public

# File lib/rom/ldap/relation.rb, line 122
def transaction(opts = EMPTY_OPTS, &block)
  Transaction.new(dataset.directory).run(opts, &block)
end