class Safrano::Filter::BinopBool

logical Bin ops

Public Instance Methods

edm_type() click to toggle source
# File lib/odata/filter/tree.rb, line 259
def edm_type
  :bool
end
leuqes(jh) click to toggle source
# File lib/odata/filter/sequel.rb, line 163
def leuqes(jh)
  leuqes_op = case @value
              when :eq
                :'='
              when :ne
                :'!='
              when :le
                :<=
              when :ge
                :'>='
              when :lt
                :<
              when :gt
                :>
              when :or
                :OR
              when :and
                :AND
              else
                return Safrano::FilterParseError
              end
  Contract.collect_result!(@children[0].leuqes(jh),
                           @children[1].leuqes(jh)) do |c0, c1|
    if c1 == NullLiteral::LEUQES
      if @value == :eq
        leuqes_op = :IS
      elsif @value == :ne
        leuqes_op = :'IS NOT'
      end
    end
    Sequel::SQL::BooleanExpression.new(leuqes_op, c0, c1)
  end
end
precedence() click to toggle source

reference: OData v4 par 5.1.1.9 Operator Precedence

# File lib/odata/filter/tree.rb, line 244
def precedence
  case @value
  when :or
    1
  when :and
    2
  when :eq, :ne
    3
  when :gt, :ge, :lt, :le, :isof
    4
  else
    999
  end
end