Class: Dry::Logic::Rule::Disjunction
- Inherits:
-
Composite
- Object
- Dry::Logic::Rule
- Composite
- Dry::Logic::Rule::Disjunction
- 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
54 55 56 57 58 59 60 61 62 |
# File 'lib/dry/logic/rule/composite.rb', line 54 def call(input) result = left.(input) if result.success? result else right.(input) end end |
#type ⇒ Object
64 65 66 |
# File 'lib/dry/logic/rule/composite.rb', line 64 def type :or end |