Class: LDAP::Filter::Base
- Inherits:
-
Object
- Object
- LDAP::Filter::Base
- Defined in:
- lib/ldap/filter/base.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #! ⇒ Object
- #&(filter) ⇒ Object
- #<<(value) ⇒ Object
-
#initialize(key, value, options = {}) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
- #|(filter) ⇒ Object
Constructor Details
#initialize(key, value, options = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ldap/filter/base.rb', line 6 def initialize key, value, ={} = { inverse: false }.merge! @key = key @value = value.to_s @wildcard_placements = [[:wildcard]].flatten @not = [:inverse] end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/ldap/filter/base.rb', line 4 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/ldap/filter/base.rb', line 4 def value @value end |
Instance Method Details
#! ⇒ Object
24 25 26 27 |
# File 'lib/ldap/filter/base.rb', line 24 def ! @not = !@not self end |
#&(filter) ⇒ Object
37 38 39 |
# File 'lib/ldap/filter/base.rb', line 37 def & filter AndFilter.new [self, filter] end |
#<<(value) ⇒ Object
29 30 31 |
# File 'lib/ldap/filter/base.rb', line 29 def << value OrFilter.new @key, @value, value end |
#to_s ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ldap/filter/base.rb', line 17 def to_s filter = '(' filter << '!' if @not filter << condition filter << ')' end |