Class: Policy::Base::Xor 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 one of its parts is valid, while another is not. #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 if there is both valid and invalid parts are present.
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 if there is both valid and invalid parts are present
Mutates the policy by adding #errors if all parts are invalid. Doesn’t add #errors if any part is valid.
31 32 33 |
# File 'lib/policy/base/xor.rb', line 31 def valid? super { return true if any_valid? && any_invalid? } end |