Class: Dry::Logic::Operations::Negation
- Inherits:
-
Unary
show all
- Defined in:
- lib/dry/logic/operations/negation.rb
Instance Attribute Summary
Attributes inherited from Unary
#rule
Attributes inherited from Abstract
#options, #rules
Instance Method Summary
collapse
Methods inherited from Unary
#ast, #initialize, #to_s
Methods inherited from Abstract
#curry, #id, #initialize, #new, #to_ast, #with
#and, #or, #then, #xor
Instance Method Details
#[](input) ⇒ Object
15
16
17
|
# File 'lib/dry/logic/operations/negation.rb', line 15
def [](input)
!rule[input]
end
|
#call(input) ⇒ Object
11
12
13
|
# File 'lib/dry/logic/operations/negation.rb', line 11
def call(input)
Result.new(rule.(input).failure?, id) { ast(input) }
end
|
#type ⇒ Object
7
8
9
|
# File 'lib/dry/logic/operations/negation.rb', line 7
def type
:not
end
|