Method: Net::LDAP::Filter#match

Defined in:
lib/net/ldap/filter.rb

#match(entry) ⇒ Object

– We got a hash of attribute values. Do we match the attributes? Return T/F, and call match recursively as necessary.



267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/net/ldap/filter.rb', line 267

def match entry
  case @op
  when :eq
    if @right == "*"
      l = entry[@left] and l.length > 0
    else
      l = entry[@left] and l = l.to_a and l.index(@right)
    end
  else
    raise LdapError.new( "unknown filter type in match: #{@op}" )
  end
end