Class: Ldaptic::Filter::Array

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

Overview

Does ? parameter substitution.

Ldaptic::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

#initialize(array) ⇒ Array

:nodoc:



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

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

Instance Method Details

#processObject



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

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