Class: Dry::Rules::Or
- Defined in:
- lib/dry/rules/or.rb
Instance Attribute Summary
Attributes inherited from Dry::Rule
Instance Method Summary collapse
Methods inherited from Binary
Methods inherited from Dry::Rule
#+, #add_error, #and, #clone, #initialize, #name, #or, #then
Constructor Details
This class inherits a constructor from Dry::Rule
Instance Method Details
#valid? ⇒ Boolean
5 6 7 8 9 |
# File 'lib/dry/rules/or.rb', line 5 def valid? return true if lt.valid? || rt.valid? [lt.errors, rt.errors].each { |e| errors.merge!(e) if e.any? } false end |