Module: ActiveLdap::Operations::Find

Defined in:
lib/active_ldap/operations.rb

Instance Method Summary collapse

Instance Method Details

#find(*args) ⇒ Object

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(:attribute => “cn”, :value => “some*val”)

Subclass.find('some*val')


194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/active_ldap/operations.rb', line 194

def find(*args)
  options = extract_options_from_args!(args)
  args = [:first] if args.empty? and !options.empty?
  case args.first
  when :first
    find_initial(options)
  when :all
    options[:value] ||= args[1]
    find_every(options)
  else
    find_from_dns(args, options)
  end
end