Module: Predicate::DyadicComp
- Includes:
- Expr
- Included in:
- Eq, Gt, Gte, Lt, Lte, Neq
- Defined in:
- lib/predicate/nodes/dyadic_comp.rb
Constant Summary
Constants included
from Expr
Expr::OP_NEGATIONS
Instance Method Summary
collapse
Methods included from Expr
#&, #and_split, #attr_split, #bind, #constant_variables, #constants, #contradiction?, #dyadic_priority, #identifier?, #literal?, #opaque?, #qualify, #rename, #sexpr, #tautology?, #to_hash, #to_postgres, #to_s, #to_sequel, #unqualify, #|
Methods included from Factory
#_factor_predicate, #and, #comp, #contradiction, #empty, #from_hash, #h, #has_size, #identifier, #in, #literal, #match, #native, #not, #opaque, #or, #pg_array_empty, #pg_array_literal, #pg_array_overlaps, #placeholder, #qualified_identifier, #sexpr, #tautology, #var, #vars
Instance Method Details
#! ⇒ Object
7
8
9
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 7
def !
Factory.send(OP_NEGATIONS[first], self[1], self[2])
end
|
#free_variables ⇒ Object
19
20
21
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 19
def free_variables
@free_variables ||= left.free_variables | right.free_variables
end
|
#left ⇒ Object
11
12
13
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 11
def left
self[1]
end
|
#priority ⇒ Object
5
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 5
def priority; 50; end
|
#right ⇒ Object
15
16
17
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 15
def right
self[2]
end
|
#var_against_literal_value? ⇒ Boolean
23
24
25
|
# File 'lib/predicate/nodes/dyadic_comp.rb', line 23
def var_against_literal_value?
left.identifier? && right.literal? && !right.has_placeholder?
end
|