Class: Ldap::Relations::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/ldap-relations/relation.rb

Overview

This class describes an individual filter that can be combined with others to be passed to an LDAP server as part of a search.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Relation

Returns a new instance of Relation.



5
6
7
# File 'lib/ldap-relations/relation.rb', line 5

def initialize params={}
  @params = params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



9
10
11
# File 'lib/ldap-relations/relation.rb', line 9

def params
  @params
end

Instance Method Details

#to_filterObject



11
12
13
# File 'lib/ldap-relations/relation.rb', line 11

def to_filter
  "()".insert 1, @params.map {|key, value| "#{key}=#{value}" }.join
end