Class: LDAP::Filter::Array

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

Overview

Does ? parameter substitution.

LDAP::Filter(["(cn=?*)","Sm"]).to_s #=> "(cn=Sm*)"

Instance Method Summary (collapse)

Methods inherited from Abstract

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

Constructor Details

- (Array) initialize(array)

:nodoc:



128
129
130
131
# File 'lib/ldap/filter.rb', line 128

def initialize(array) #:nodoc:
  @template = array.first
  @parameters = array[1..-1]
end

Instance Method Details

- (Object) process



132
133
134
135
# File 'lib/ldap/filter.rb', line 132

def process
  parameters = @parameters.dup
  string = @template.gsub('?') { LDAP.escape(parameters.pop) }
end