Class: Dry::Logic::Rule::Negation

Inherits:
Value show all
Defined in:
lib/dry/logic/rule/negation.rb

Instance Attribute Summary

Attributes inherited from Dry::Logic::Rule

#options, #predicate

Instance Method Summary collapse

Methods inherited from Value

#apply, #evaluate, #to_ast

Methods inherited from Dry::Logic::Rule

#and, #curry, #each?, #initialize, #negation, #new, #or, #predicate_id, #then, #xor

Constructor Details

This class inherits a constructor from Dry::Logic::Rule

Instance Method Details

#call(input) ⇒ Object



9
10
11
# File 'lib/dry/logic/rule/negation.rb', line 9

def call(input)
  predicate.(input).negated
end

#typeObject



5
6
7
# File 'lib/dry/logic/rule/negation.rb', line 5

def type
  :not
end