Class: Predicated::Not
- Inherits:
-
Unary
show all
- Includes:
- Container, JsonStructToJsonStr
- Defined in:
- lib/predicated/to/xml.rb,
lib/predicated/to/arel.rb,
lib/predicated/to/json.rb,
lib/predicated/to/solr.rb,
lib/predicated/evaluate.rb,
lib/predicated/predicate.rb,
lib/predicated/to/sentence.rb,
lib/predicated/simple_templated_predicate.rb
Instance Attribute Summary
Attributes inherited from Unary
#inner
Class Method Summary
collapse
Instance Method Summary
collapse
#to_json_str
Methods inherited from Unary
#initialize, #to_s
#==
#each
#inspect
Methods inherited from Predicate
from_callable_object, from_json_str, from_json_struct, from_ruby_code_string, from_url_part, from_xml
Class Method Details
.shorthand ⇒ Object
81
|
# File 'lib/predicated/predicate.rb', line 81
def self.shorthand; :Not end
|
Instance Method Details
90
91
92
|
# File 'lib/predicated/evaluate.rb', line 90
def evaluate
! boolean_or_evaluate(inner)
end
|
#fill_in(placeholder_replacement) ⇒ Object
27
28
29
|
# File 'lib/predicated/simple_templated_predicate.rb', line 27
def fill_in(placeholder_replacement)
Not.new(inner.fill_in(placeholder_replacement))
end
|
#to_arel(arel_table) ⇒ Object
22
23
24
|
# File 'lib/predicated/to/arel.rb', line 22
def to_arel(arel_table)
Arel::Predicates::Not.new(inner.to_arel(arel_table))
end
|
#to_json_struct ⇒ Object
29
30
31
|
# File 'lib/predicated/to/json.rb', line 29
def to_json_struct
{"not" => inner.to_json_struct}
end
|
#to_negative_sentence ⇒ Object
24
25
26
|
# File 'lib/predicated/to/sentence.rb', line 24
def to_negative_sentence
inner.to_sentence
end
|
#to_sentence ⇒ Object
20
21
22
|
# File 'lib/predicated/to/sentence.rb', line 20
def to_sentence
inner.to_negative_sentence
end
|
7
|
# File 'lib/predicated/to/solr.rb', line 7
def to_solr; "NOT(#{inner.to_solr})" end
|
#to_xml(indent = "") ⇒ Object
28
29
30
|
# File 'lib/predicated/to/xml.rb', line 28
def to_xml(indent="")
"#{indent}<not>\n#{inner.to_xml(indent + " ")}\n#{indent}</not>"
end
|