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, inverse = false) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
- #|(filter) ⇒ Object
Constructor Details
#initialize(key, value, inverse = false) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/ldap/filter/base.rb', line 6 def initialize key, value, inverse=false @key = key @value = value.to_s @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
19 20 21 22 |
# File 'lib/ldap/filter/base.rb', line 19 def ! @not = !@not self end |
#&(filter) ⇒ Object
32 33 34 |
# File 'lib/ldap/filter/base.rb', line 32 def & filter AndFilter.new [self, filter] end |
#<<(value) ⇒ Object
24 25 26 |
# File 'lib/ldap/filter/base.rb', line 24 def << value OrFilter.new @key, @value, value end |
#to_s ⇒ Object
12 13 14 15 16 17 |
# File 'lib/ldap/filter/base.rb', line 12 def to_s filter = '(' filter << '!' if @not filter << condition filter << ')' end |
#|(filter) ⇒ Object
28 29 30 |
# File 'lib/ldap/filter/base.rb', line 28 def | filter OrFilter.new [self, filter] end |