Class: CSDL::QueryFilterProcessor

Inherits:
Processor
  • Object
show all
Defined in:
lib/csdl/query_filter_processor.rb

Overview

QueryFilterProcessor is a class that inherits from Processor, providing additional methods for building CSDL specifically for Query Filters.

Instance Method Summary collapse

Methods inherited from Processor

#on_and, #on_argument, #on_condition, #on_logical_group, #on_not, #on_operator, #on_or, #on_raw, #on_root, #on_string, #on_target

Instance Method Details

#validate_target!(target_key) ⇒ void

This method returns an undefined value.

Raises an InvalidQueryTargetError if the target isn’t a valid CSDL target for query filters. Will be called from the base class when given a :condition node with a :target node.

Examples:

CSDL::QueryFilterProcessorProcessor.new.validate_target!("fake") # => raises InvalidQueryTargetError

Parameters:

  • target_key (String)

    The target to validate.

Raises:

See Also:



29
30
31
32
33
# File 'lib/csdl/query_filter_processor.rb', line 29

def validate_target!(target_key)
  unless ::CSDL.query_target?(target_key)
    fail ::CSDL::InvalidQueryTargetError, "Query filters cannot use target '#{target_key}'"
  end
end