Class: Ldap::Relations::Relation
- Inherits:
-
Object
- Object
- Ldap::Relations::Relation
- 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
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Relation
constructor
A new instance of Relation.
- #to_filter ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Relation
Returns a new instance of Relation.
5 6 7 8 |
# File 'lib/ldap-relations/relation.rb', line 5 def initialize params={} @operator = params.fetch :operator, :and @params = params end |
Instance Attribute Details
#operator ⇒ Object
Returns the value of attribute operator.
10 11 12 |
# File 'lib/ldap-relations/relation.rb', line 10 def operator @operator end |
#params ⇒ Object
Returns the value of attribute params.
10 11 12 |
# File 'lib/ldap-relations/relation.rb', line 10 def params @params end |
Instance Method Details
#to_filter ⇒ Object
12 13 14 |
# File 'lib/ldap-relations/relation.rb', line 12 def to_filter @params.map {|key, value| "#{key}=#{value}" }.join end |