Class: Ambition::Adapters::ActiveLdap::Select

Inherits:
Base
  • Object
show all
Defined in:
lib/ambition/adapters/active_ldap/select.rb

Instance Method Summary collapse

Methods inherited from Base

#sanitize

Instance Method Details

#<(left, right) ⇒ Object



42
43
44
# File 'lib/ambition/adapters/active_ldap/select.rb', line 42

def <(left, right)
  self.<=(left, right)
end

#<=(left, right) ⇒ Object



54
55
56
# File 'lib/ambition/adapters/active_ldap/select.rb', line 54

def <=(left, right)
  "(#{left}<=#{sanitize right})"
end

#==(left, right) ⇒ Object



26
27
28
# File 'lib/ambition/adapters/active_ldap/select.rb', line 26

def ==(left, right)
  "(#{left}=#{sanitize right})"
end

#=~(left, right) ⇒ Object



35
36
# File 'lib/ambition/adapters/active_ldap/select.rb', line 35

def =~(left, right)
end

#>(left, right) ⇒ Object



46
47
48
# File 'lib/ambition/adapters/active_ldap/select.rb', line 46

def >(left, right)
  self.>=(left, right)
end

#>=(left, right) ⇒ Object



50
51
52
# File 'lib/ambition/adapters/active_ldap/select.rb', line 50

def >=(left, right)
  "(#{left}>=#{sanitize right})"
end

#both(left, right) ⇒ Object



18
19
20
# File 'lib/ambition/adapters/active_ldap/select.rb', line 18

def both(left, right)
  "(&#{left}#{sanitize right})"
end

#call(*methods) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/ambition/adapters/active_ldap/select.rb', line 5

def call(*methods)
  method = methods.first.to_s
  if method[-1] == ??
    "(#{method[0...-1]}=#{sanitize true})"
  else
    method
  end
end

#chained_call(*methods) ⇒ Object



14
15
16
# File 'lib/ambition/adapters/active_ldap/select.rb', line 14

def chained_call(*methods)
  call(*methods)
end

#either(left, right) ⇒ Object



22
23
24
# File 'lib/ambition/adapters/active_ldap/select.rb', line 22

def either(left, right)
  "(|#{left}#{sanitize right})"
end

#include?(left, right) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
61
# File 'lib/ambition/adapters/active_ldap/select.rb', line 58

def include?(left, right)
  bits = left.map { |item| "(#{right}=#{item})" }
  "(|#{bits})"
end

#not_equal(left, right) ⇒ Object

!=



31
32
33
# File 'lib/ambition/adapters/active_ldap/select.rb', line 31

def not_equal(left, right)
  "(!(#{left}=#{sanitize right}))"
end

#not_regexp(left, right) ⇒ Object

!~



39
40
# File 'lib/ambition/adapters/active_ldap/select.rb', line 39

def not_regexp(left, right)
end