Module: ROM::LDAP::Dataset::DSL Private

Included in:
ROM::LDAP::Dataset
Defined in:
lib/rom/ldap/dataset/dsl.rb

Overview

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

AST Query Interface

Instance Method Summary collapse

Instance Method Details

#approx(args) ⇒ Dataset

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.

Parameters:

  • args (Hash)

Returns:



173
174
175
# File 'lib/rom/ldap/dataset/dsl.rb', line 173

def approx(args)
  chain(:op_prx, *args.to_a[0])
end

#begins(args) ⇒ Dataset

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.

Starts with filter

Parameters:

  • args (Hash)

Returns:



116
117
118
# File 'lib/rom/ldap/dataset/dsl.rb', line 116

def begins(args)
  chain(*match_dsl(args, right: WILDCARD))
end

#binary_equal(args) ⇒ Dataset

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.

Parameters:

  • args (Hash)

Returns:



166
167
168
# File 'lib/rom/ldap/dataset/dsl.rb', line 166

def binary_equal(args)
  chain(:op_bineq, *args.to_a[0])
end

#bitwise(args) ⇒ Dataset

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.

Parameters:

  • args (Hash)

Returns:



180
181
182
# File 'lib/rom/ldap/dataset/dsl.rb', line 180

def bitwise(args)
  chain(:op_ext, *args.to_a[0])
end

#contains(args) ⇒ Dataset Also known as: matches

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.

Parameters:

  • args (Hash)

Returns:



132
133
134
# File 'lib/rom/ldap/dataset/dsl.rb', line 132

def contains(args)
  chain(*match_dsl(args, left: WILDCARD, right: WILDCARD))
end

#ends(args) ⇒ Dataset

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.

Ends with filter

Parameters:

  • args (Hash)

Returns:



125
126
127
# File 'lib/rom/ldap/dataset/dsl.rb', line 125

def ends(args)
  chain(*match_dsl(args, left: WILDCARD))
end

#equal(args) ⇒ Dataset

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.

Equality filter aliased as ‘where’.

Examples:

relation.where(uid: 'Pietro')
relation.where(uid: %w[Pietro Wanda])
relation.where(uid: 'Pietro', sn: 'Maximoff')

Parameters:

  • args (Hash)

Returns:



28
29
30
# File 'lib/rom/ldap/dataset/dsl.rb', line 28

def equal(args)
  chain(*array_dsl(args))
end

#excludes(args) ⇒ Dataset

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.

negate #contains

Parameters:

  • args (Hash)

Returns:



142
143
144
# File 'lib/rom/ldap/dataset/dsl.rb', line 142

def excludes(args)
  chain(:con_not, match_dsl(args, left: WILDCARD, right: WILDCARD))
end

#gt(args) ⇒ Dataset Also known as: above

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.

Greater than filter

Parameters:

  • args (Hash)

Returns:



78
79
80
# File 'lib/rom/ldap/dataset/dsl.rb', line 78

def gt(args)
  chain(:con_not, [:op_lte, *args.to_a[0]])
end

#gte(args) ⇒ Dataset

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.

Greater than or equal filter

Parameters:

  • args (Hash)

Returns:



98
99
100
# File 'lib/rom/ldap/dataset/dsl.rb', line 98

def gte(args)
  chain(:op_gte, *args.to_a[0])
end

#inverseDataset

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.

Invert the whole query

Returns:



14
15
16
# File 'lib/rom/ldap/dataset/dsl.rb', line 14

def inverse
  with(criteria: [:con_not, criteria])
end

#lt(args) ⇒ Dataset Also known as: below

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.

Less than filter

Parameters:

  • args (Hash)

Returns:



88
89
90
# File 'lib/rom/ldap/dataset/dsl.rb', line 88

def lt(args)
  chain(:con_not, [:op_gte, *args.to_a[0]])
end

#lte(args) ⇒ Dataset

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.

Less than or equal filter

Parameters:

  • args (Hash)

Returns:



107
108
109
# File 'lib/rom/ldap/dataset/dsl.rb', line 107

def lte(args)
  chain(:op_lte, *args.to_a[0])
end

#missing(attribute) ⇒ Dataset Also known as: hasnt

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.

Absence filter aliased as ‘hasnt’. Inverse of ‘present’.

Examples:

relation.missing(:uid)
relation.hasnt(:mail)

Parameters:

  • attribute (Symbol)

Returns:



68
69
70
# File 'lib/rom/ldap/dataset/dsl.rb', line 68

def missing(attribute)
  chain(:con_not, [:op_eql, attribute, :wildcard])
end

#outside(args) ⇒ Dataset

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.

negate #outside

Parameters:

  • args (Range)

Returns:



159
160
161
# File 'lib/rom/ldap/dataset/dsl.rb', line 159

def outside(args)
  chain(:con_not, [:con_and, cover_dsl(args)])
end

#present(attribute) ⇒ Dataset Also known as: has

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.

Presence filter aliased as ‘has’.

Examples:

relation.present(:uid)
relation.has(:mail)

Parameters:

  • attribute (Symbol)

Returns:



54
55
56
# File 'lib/rom/ldap/dataset/dsl.rb', line 54

def present(attribute)
  chain(:op_eql, attribute, :wildcard)
end

#unequal(args) ⇒ Dataset

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.

Antonym of ‘equal’

Examples:

relation.unequal(uid: 'Pietro')
relation.unequal(uid: %w[Pietro Wanda])

Parameters:

  • args (Hash)

Returns:



41
42
43
# File 'lib/rom/ldap/dataset/dsl.rb', line 41

def unequal(args)
  chain(:con_not, array_dsl(args))
end

#within(args) ⇒ Dataset Also known as: between

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.

Parameters:

  • args (Range)

Returns:



149
150
151
# File 'lib/rom/ldap/dataset/dsl.rb', line 149

def within(args)
  chain(:con_and, cover_dsl(args))
end