Class: Net::LDAP::Filter::FilterParser
- Inherits:
-
Object
- Object
- Net::LDAP::Filter::FilterParser
- Defined in:
- lib/net/ldap/filter.rb
Overview
Parses RFC 2254-style string representations of LDAP filters into Filter object hierarchies.
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
The constructed filter.
Class Method Summary collapse
-
.parse(ldap_filter_string) ⇒ Object
Construct a filter tree from the provided string and return it.
Instance Method Summary collapse
-
#initialize(str) ⇒ FilterParser
constructor
A new instance of FilterParser.
Constructor Details
#initialize(str) ⇒ FilterParser
Returns a new instance of FilterParser.
678 679 680 681 682 |
# File 'lib/net/ldap/filter.rb', line 678 def initialize(str) require 'strscan' # Don't load strscan until we need it. @filter = parse(StringScanner.new(str)) raise Net::LDAP::FilterSyntaxInvalidError, "Invalid filter syntax." unless @filter end |
Instance Attribute Details
#filter ⇒ Object (readonly)
The constructed filter.
666 667 668 |
# File 'lib/net/ldap/filter.rb', line 666 def filter @filter end |
Class Method Details
.parse(ldap_filter_string) ⇒ Object
Construct a filter tree from the provided string and return it.
673 674 675 |
# File 'lib/net/ldap/filter.rb', line 673 def parse(ldap_filter_string) new(ldap_filter_string).filter end |