class Net::LDAP::Filter
def execute(&block)
* :not (one argument, which is an object returned from a recursive
a recursive call to #execute, with the same block; and
* :or (two or more arguments, each of which is an object returned from
from a recursive call to #execute, with the same block;
* :and (two or more arguments, each of which is an object returned
compared against);
* :lessOrEqual (two arguments: an attribute name and a value to be
compared against);
* :greaterOrEqual (two arguments: an attribute name and a value to be
* :present (one argument: an attribute name);
one or more "*" characters);
* :substrings (two arguments: an attribute name and a value containing
to be matched);
* :equalityMatch (the arguments will be an attribute name and a value
block:
These are the possible values that may be passed to the user-supplied
Net::LDAP::Filter objects.
A typical object to return from the user-supplied block is an array of
:or and :not operations detailed below.
locally-meaningful object that will appear as a parameter in the :and,
some desired application-defined processing, and may return a
operation. The user-supplied block (which is MANDATORY) should perform
the filter; and second, an array consisting of arguments to the
called with two arguments: first, a symbol denoting the "operation" of
when implementing an LDAP directory server. The caller's block will be
Perform filter operations against a user-supplied block. This is useful
#
def execute(&block) case @op when :eq if @right == "*" yield :present, @left elsif @right.index '*' yield :substrings, @left, @right else yield :equalityMatch, @left, @right end when :ge yield :greaterOrEqual, @left, @right when :le yield :lessOrEqual, @left, @right when :or, :and yield @op, (@left.execute(&block)), (@right.execute(&block)) when :not yield @op, (@left.execute(&block)) end || [] end