Class: Treequel::Filter::PresentItemComponent
- Inherits:
-
ItemComponent
- Object
- Component
- ItemComponent
- Treequel::Filter::PresentItemComponent
- Defined in:
- lib/treequel/filter.rb
Overview
A ‘present’ (attribute=*) component
Constant Summary collapse
- DEFAULT_ATTRIBUTE =
The default attribute to test for presence if none is specified
:objectClass
Instance Method Summary collapse
-
#initialize(attribute = DEFAULT_ATTRIBUTE) ⇒ PresentItemComponent
constructor
Create a new ‘presence’ item filter component for the given
attribute. -
#promiscuous? ⇒ Boolean
Returns true, indicating that this component in a filter will match every entry if its attribute is ‘objectClass’.
-
#to_s ⇒ Object
Stringify the component.
Methods inherited from Component
Constructor Details
#initialize(attribute = DEFAULT_ATTRIBUTE) ⇒ PresentItemComponent
Create a new ‘presence’ item filter component for the given attribute.
308 309 310 |
# File 'lib/treequel/filter.rb', line 308 def initialize( attribute=DEFAULT_ATTRIBUTE ) @attribute = attribute end |
Instance Method Details
#promiscuous? ⇒ Boolean
Returns true, indicating that this component in a filter will match every entry if its attribute is ‘objectClass’.
321 322 323 |
# File 'lib/treequel/filter.rb', line 321 def promiscuous? return @attribute.to_sym == DEFAULT_ATTRIBUTE end |
#to_s ⇒ Object
Stringify the component
314 315 316 |
# File 'lib/treequel/filter.rb', line 314 def to_s return @attribute.to_s + '=*' end |