Class: ROM::LDAP::Parsers::FilterSyntax Private

Inherits:
Object
  • Object
show all
Extended by:
Initializer
Defined in:
lib/rom/ldap/parsers/filter_syntax.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Parses a filter into an AST

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/rom/ldap/parsers/filter_syntax.rb', line 20

def result
  @result
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rom/ldap/parsers/filter_syntax.rb', line 22

def call
  if open_statement
    if joined_statement
      join_type = encode_constructor

      branches = []

      while (branch = call)
        branches << branch
      end

      self.result = [join_type, branches]

    elsif negated_statement
      negator = encode_constructor
      self.result = [negator, call]

    else
      skip_whitespace
      scan_attribute
      attribute = encode_attribute

      skip_whitespace
      scan_operator
      op = encode_operator

      skip_whitespace
      scan_value
      value = encode_value

      self.result = [op, attribute, value]
    end

    close_statement

    result
  end
end