Class: ROM::LDAP::RestrictionDSL Private

Inherits:
DSL
  • Object
show all
Defined in:
lib/rom/ldap/restriction_dsl.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 Attribute Summary

Attributes inherited from DSL

#picked_relations, #relations, #schema

Instance Method Summary collapse

Methods inherited from DSL

#initialize, #respond_to_missing?

Constructor Details

This class inherits a constructor from ROM::LDAP::DSL

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Attribute, Type (private)

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.

Returns:



35
36
37
38
39
40
41
# File 'lib/rom/ldap/restriction_dsl.rb', line 35

def method_missing(meth, *args, &block)
  if schema.key?(meth)
    schema[meth]
  else
    type(meth)
  end
end

Instance Method Details

#`(value) ⇒ AST

Parse a raw query to AST.

Examples:

animals.where { `(cn=dodo)` }.count

Parameters:

  • value (String)

Returns:

  • (AST)


26
27
28
# File 'lib/rom/ldap/restriction_dsl.rb', line 26

def `(value)
  Parsers::FilterSyntax.new(value, EMPTY_ARRAY).call
end

#call(&block) ⇒ Object

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.



12
13
14
# File 'lib/rom/ldap/restriction_dsl.rb', line 12

def call(&block)
  instance_exec(select_relations(block.parameters), &block)
end