module ActiveLdap::Operations::Find

Public Instance Methods

all(*args) click to toggle source

This is an alias for find(:all). You can pass in all the same arguments to this method as you can to find(:all)

# File lib/active_ldap/operations.rb, line 260
def all(*args)
  find(:all, *args)
end
find(*args) click to toggle source

find

Finds the first match for value where |value| is the value of some |field|, or the wildcard match. This is only useful for derived classes. usage: Subclass.find(:all, :attribute => "cn", :value => "some*val")

Subclass.find(:all, 'some*val')
# File lib/active_ldap/operations.rb, line 225
def find(*args)
  options = extract_options_from_args!(args)
  args = [:first] if args.empty? and !options.empty?
  case args.first
  when :first
    options[:value] ||= args[1]
    find_initial(options)
  when :last
    options[:value] ||= args[1]
    find_last(options)
  when :all
    options[:value] ||= args[1]
    find_every(options)
  else
    find_from_dns(args, options)
  end
end
first(*args) click to toggle source

A convenience wrapper for find(:first, *args). You can pass in all the same arguments to this method as you can to find(:first).

# File lib/active_ldap/operations.rb, line 246
def first(*args)
  find(:first, *args)
end
last(*args) click to toggle source

A convenience wrapper for find(:last, *args). You can pass in all the same arguments to this method as you can to find(:last).

# File lib/active_ldap/operations.rb, line 253
def last(*args)
  find(:last, *args)
end