Class: ROM::LDAP::Relation

Inherits:
Relation
  • Object
show all
Extended by:
Notifications::Listener
Includes:
ROM::LDAP, DSMLExport, MsgPackExport, OptimisedJSON, Exporting, Reading, Writing
Defined in:
lib/rom/ldap/relation.rb,
lib/rom/ldap/relation/reading.rb,
lib/rom/ldap/relation/writing.rb,
lib/rom/ldap/relation/exporting.rb

Defined Under Namespace

Modules: Exporting, Reading, Writing

Constant Summary

Constants included from ROM::LDAP

ABSTRACTS, ALL_ATTRS, BIN_FILE_REGEX, BOOLEAN_MATCHERS, BindError, CONNECTION_FAILURES, CONSTRUCTORS, CONSTRUCTOR_REGEX, ConnectionError, DEFAULT_FILTER, DEFAULT_FORMATTER, DEFAULT_PK, DEREF_ALL, DEREF_ALWAYS, DEREF_FIND, DEREF_NEVER, DEREF_SEARCH, DN_REGEX, DistinguishedNameError, ESCAPES, ESCAPE_REGEX, EXTENSIBLE_REGEX, FILTER_REGEX, INTEGER_MATCHERS, LDAPURI_REGEX, LDIF_LINE_REGEX, MAJOR, MINOR, MessageQueue, NEW_LINE, OID, OID_TYPE_MAP, OPERATORS, OPERATOR_REGEX, OP_ATTRS, PERCENT_SPACE, PasswordError, RESPONSES, RESPONSES_PATH, ResponseError, SCOPES, SCOPE_BASE, SCOPE_ONE, SCOPE_SUB, SINCE_1601, SPACE, STRING_MATCHERS, SUCCESS_CODES, SecureBindError, TEN_MILLION, TIMESTAMPS, TIME_MATCHERS, TINY, UNESCAPE_REGEX, VALUES_MAP, VAL_REGEX, VERSION, WILDCARD

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OptimisedJSON

#to_json

Methods included from MsgPackExport

#to_msgpack

Methods included from DSMLExport

#to_dsml

Methods included from Exporting

#to_json, #to_ldif, #to_yaml

Methods included from Writing

#delete, #insert, #update

Methods included from Reading

#all?, #any?, #authenticate, #branch, #by_pk, #count, #fetch, #first, #grep, #last, #limit, #list, #map, #none?, #one?, #operational, #order, #pluck, #random, #rename, #reverse, #search, #select, #select_append, #total, #unfiltered, #unwrap, #where, #whole_tree, #with_base

Methods included from ROM::LDAP

LDIF, formatter, use_formatter

Class Method Details

.associationsObject



101
102
103
# File 'lib/rom/ldap/relation.rb', line 101

def self.associations
  schema.associations
end

.baseString .base(value) ⇒ Object

Per relation override for the search base.

Overloads:

  • .baseString

    Return search base value

    Returns:

    • (String)
  • .base(value) ⇒ Object

    Set search base value



32
# File 'lib/rom/ldap/relation.rb', line 32

defines :base

.branchesHash .branches(value) ⇒ Object

Alternative search bases by name.

Overloads:

  • .branchesHash

    Return hash of search branches.

    Returns:

    • (Hash)
  • .branches(value) ⇒ Object

    Set hash of search branches.



43
# File 'lib/rom/ldap/relation.rb', line 43

defines :branches

Instance Method Details

#assoc(name) ⇒ Relation

Returns:



108
109
110
# File 'lib/rom/ldap/relation.rb', line 108

def assoc(name)
  associations[name].call
end

#baseString

Expose the search base currently in use.

Returns:

  • (String)

    current base



87
88
89
# File 'lib/rom/ldap/relation.rb', line 87

def base
  dataset.opts[:base]
end

#primary_keySymbol

Fallsback to ‘entrydn’ operational value.

Returns:

  • (Symbol)


72
73
74
75
76
77
78
79
80
# 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_filterString

Current dataset in LDAP filter format.

Returns:

  • (String)


96
97
98
# File 'lib/rom/ldap/relation.rb', line 96

def to_filter
  dataset.opts[:filter]
end

#transaction(opts = EMPTY_OPTS) {|t| ... } ⇒ Mixed

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

Yields:

  • (t)

    Transaction

Returns:

  • (Mixed)

See Also:



122
123
124
# File 'lib/rom/ldap/relation.rb', line 122

def transaction(opts = EMPTY_OPTS, &block)
  Transaction.new(dataset.directory).run(opts, &block)
end