A ‘substring’ (attribute=foo*) component
The name of the attribute to match against
The attribute options
The pattern to match (if the index exists in the directory)
Create a new ‘substring’ item filter component that will match the
specified pattern against the given attribute.
# File lib/treequel/filter.rb, line 337
def initialize( attribute, pattern, options=nil )
@attribute = attribute
@pattern = pattern
@options = options
super()
end
Parse the substring item from the given literal.
# File lib/treequel/filter.rb, line 321
def self::parse_from_string( literal )
match = LDAP_SUBSTRING_FILTER.match( literal ) or
raise Treequel::ExpressionError,
"unable to parse %p as a substring literal" % [ literal ]
Treequel.logger.debug " parsed substring literal as: %p" % [ match.captures ]
return self.new( *(match.captures.values_at(1,3,2)) )
end
Stringify the component
# File lib/treequel/filter.rb, line 361
def to_s
return self.attribute.to_s + self.options.to_s + '=' + self.pattern
end
| / | Search |
|---|---|
| ? | Show this help |