Class: Ldaptic::Filter::Join

Inherits:
Abstract show all
Defined in:
lib/ldaptic/filter.rb

Overview

Used in the implementation of Ldaptic::Filter::And and Ldaptic::Filter::Or. For internal use only.

Direct Known Subclasses

And, Or

Instance Method Summary collapse

Methods inherited from Abstract

#&, #inspect, #to_ber, #to_s, #|, #~

Constructor Details

#initialize(operator, *args) ⇒ Join

:nodoc:



141
142
143
# File 'lib/ldaptic/filter.rb', line 141

def initialize(operator, *args) #:nodoc:
  @array = [operator] + args.map {|arg| Ldaptic::Filter(arg)}
end

Instance Method Details

#processObject



144
145
146
# File 'lib/ldaptic/filter.rb', line 144

def process
  "(#{@array*''})" if @array.compact.size > 1
end

#to_net_ldap_filterObject

:nodoc:



147
148
149
# File 'lib/ldaptic/filter.rb', line 147

def to_net_ldap_filter #:nodoc:
  @array[1..-1].inject {|m, o| m.to_net_ldap_filter.send(@array.first, o.to_net_ldap_filter)}
end