Class: Policy::Base::Or Private
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Composition of two policies
The policy is valid if any of its parts is valid. #valid? method picks errors from its parts in case both are invalid.
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#valid? ⇒ Boolean
private
Checks whether any part of composition is valid.
Methods inherited from Node
Methods included from Policy::Base
Instance Method Details
#valid? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks whether any part of composition is valid
Mutates the policy by adding #errors in case all parts are invalid. Doesn’t add #errors if any policy is valid.
31 32 33 |
# File 'lib/policy/base/or.rb', line 31 def valid? super { return true if any_valid? } end |