Module: Attestor::Policy::Factory
- Included in:
- Attestor::Policy
- Defined in:
- lib/attestor/policy/factory.rb
Overview
The collection of factory methods for creating complex policies
Instance Method Summary collapse
-
#and(policy, *others) ⇒ Object
Builds the AND composition of policy with other policies.
-
#not(policy) ⇒ Attestor::Policy::Not
Builds the negation of given policy.
-
#or(policy, *others) ⇒ Object
Builds the OR composition of policy with other policies.
-
#xor(policy, *others) ⇒ Object
Builds the XOR composition of policy with other policies.
Instance Method Details
#and(policy, *others) ⇒ Attestor::Policy::And #and(policy) ⇒ Attestor::Policy::Negator
Builds the AND composition of policy with other policies
25 26 27 |
# File 'lib/attestor/policy/factory.rb', line 25 def and(policy, *others) __factory_method__(And, policy, others) end |
#not(policy) ⇒ Attestor::Policy::Not
Builds the negation of given policy
72 73 74 |
# File 'lib/attestor/policy/factory.rb', line 72 def not(policy) Not.new(policy) end |
#or(policy, *others) ⇒ Attestor::Policy::Or #or(policy) ⇒ Attestor::Policy::Negator
Builds the OR composition of policy with other policies
44 45 46 |
# File 'lib/attestor/policy/factory.rb', line 44 def or(policy, *others) __factory_method__(Or, policy, others) end |
#xor(policy, *others) ⇒ Attestor::Policy::Xor #xor(policy) ⇒ Attestor::Policy::Negator
Builds the XOR composition of policy with other policies
63 64 65 |
# File 'lib/attestor/policy/factory.rb', line 63 def xor(policy, *others) __factory_method__(Xor, policy, others) end |