Class: Dry::Logic::Rule::Implication
- Inherits:
-
Composite
- Object
- Dry::Logic::Rule
- Composite
- Dry::Logic::Rule::Implication
- Defined in:
- lib/dry/logic/rule/composite.rb
Instance Attribute Summary
Attributes inherited from Composite
Attributes inherited from Dry::Logic::Rule
Instance Method Summary collapse
Methods inherited from Composite
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::Composite
Instance Method Details
#call(input) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/dry/logic/rule/composite.rb', line 24 def call(input) if left.(input).success? right.(input) else Logic.Result(true, left, input) end end |
#type ⇒ Object
32 33 34 |
# File 'lib/dry/logic/rule/composite.rb', line 32 def type :implication end |