Class: ROM::LDAP::Expression Private
- Inherits:
-
Object
- Object
- ROM::LDAP::Expression
- Extended by:
- Initializer
- Defined in:
- lib/rom/ldap/expression.rb
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.
Instance Method Summary collapse
- #inspect ⇒ String private
-
#to_ast ⇒ Array
(also: #to_a)
private
AST with original atrributes and values.
- #to_ber ⇒ String
-
#to_filter ⇒ String
(also: #to_s)
private
Bracketed filter string.
-
#to_raw_filter ⇒ String
private
Unbracketed filter string.
Instance Method Details
#inspect ⇒ String
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.
71 72 73 |
# File 'lib/rom/ldap/expression.rb', line 71 def inspect %(#<#{self.class} #{to_raw_filter} />) end |
#to_ast ⇒ Array Also known as: to_a
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.
AST with original atrributes and values
58 59 60 61 62 63 64 65 66 |
# File 'lib/rom/ldap/expression.rb', line 58 def to_ast case op when :con_and then [op, exps.map(&:to_ast)] when :con_or then [op, exps.map(&:to_ast)] when :con_not then [op, exps[0].to_ast] else [op, field, value] end end |
#to_ber ⇒ String
23 24 25 26 |
# File 'lib/rom/ldap/expression.rb', line 23 def to_ber require 'rom/ldap/expression_encoder' ExpressionEncoder.new().call end |
#to_filter ⇒ String Also known as: to_s
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.
Bracketed filter string
49 50 51 |
# File 'lib/rom/ldap/expression.rb', line 49 def to_filter "(#{to_raw_filter})" end |
#to_raw_filter ⇒ String
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.
Unbracketed filter string
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rom/ldap/expression.rb', line 32 def to_raw_filter case op when :op_eql, :op_bineq then "#{field}=#{value}" when :op_ext then "#{field}:=#{value}" when :op_gte then "#{field}>=#{value}" when :op_lte then "#{field}<=#{value}" when :op_prx then "#{field}~=#{value}" when :con_and then "&#{exps.map(&:to_filter).join}" when :con_or then "|#{exps.map(&:to_filter).join}" when :con_not then "!#{exps[0].to_filter}" end end |