Module: Predicate::Literal
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
#empty_value? ⇒ Boolean
19
20
21
22
|
# File 'lib/predicate/nodes/literal.rb', line 19
def empty_value?
return false if has_placeholder?
value.respond_to?(:empty?) && value.empty?
end
|
#evaluate(tuple) ⇒ Object
29
30
31
32
|
# File 'lib/predicate/nodes/literal.rb', line 29
def evaluate(tuple)
raise UnboundError if has_placeholder?
value
end
|
#free_variables ⇒ Object
7
8
9
|
# File 'lib/predicate/nodes/literal.rb', line 7
def free_variables
@free_variables ||= []
end
|
#has_placeholder? ⇒ Boolean
15
16
17
|
# File 'lib/predicate/nodes/literal.rb', line 15
def has_placeholder?
value.is_a?(Placeholder)
end
|
#priority ⇒ Object
5
|
# File 'lib/predicate/nodes/literal.rb', line 5
def priority; 100; end
|
#singleton_value? ⇒ Boolean
24
25
26
27
|
# File 'lib/predicate/nodes/literal.rb', line 24
def singleton_value?
return false if has_placeholder?
value.respond_to?(:size) && value.size == 1
end
|
#value ⇒ Object
11
12
13
|
# File 'lib/predicate/nodes/literal.rb', line 11
def value
last
end
|