def find(source = @source)
      scope = 0
      filter = "(objectClass=*)"
      if source.respond_to?(:search2_ext)
        source.search2(
          to_s,
          scope,
          filter
        )
      elsif source.respond_to?(:search)
        Array(source.search(
          :base => to_s,
          :scope => scope,
          :filter => filter,
          :limit => 1
        ))
      else
        raise RuntimeError, "missing or invalid source for LDAP search", caller
      end.first
    end
def find(source = @source)
      scope = 0
      filter = "(objectClass=*)"
      if source.respond_to?(:search2_ext)
        source.search2(
          to_s,
          scope,
          filter
        )
      elsif source.respond_to?(:search)
        Array(source.search(
          :base => to_s,
          :scope => scope,
          :filter => filter,
          :limit => 1
        ))
      else
        raise RuntimeError, "missing or invalid source for LDAP search", caller
      end.first
    end
If a source object was given, it is used to search for the DN.
 Otherwise, an exception is raised.