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')


170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/active_ldap/operations.rb', line 170

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