wrstudios/odata4

View on GitHub
lib/odata4/query/criteria/lambda_operators.rb

Summary

Maintainability
A
0 mins
Test Coverage
module OData4
  class Query
    class Criteria
      module LambdaOperators
        # Applies the `any` lambda operator to the given property
        # @param property [to_s]
        # @return [self]
        def any(property)
          set_function_and_argument(:any, property)
        end

        # Applies the `any` lambda operator to the given property
        # @param property [to_s]
        # @return [self]
        def all(property)
          set_function_and_argument(:all, property)
        end

        private

        def lambda_operator?
          [:any, :all].include?(function)
        end
      end
    end
  end
end