Class: Attestor::Policy::Negator
- Inherits:
-
Object
- Object
- Attestor::Policy::Negator
- Defined in:
- lib/attestor/policy/negator.rb
Instance Attribute Summary collapse
-
#composer ⇒ Object
readonly
Returns the value of attribute composer.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
Instance Method Summary collapse
-
#initialize(composer, policy) ⇒ Negator
constructor
A new instance of Negator.
- #not(*policies) ⇒ Object
Constructor Details
#initialize(composer, policy) ⇒ Negator
Returns a new instance of Negator.
10 11 12 13 14 |
# File 'lib/attestor/policy/negator.rb', line 10 def initialize(composer, policy) @policy = policy @composer = composer freeze end |
Instance Attribute Details
#composer ⇒ Object (readonly)
Returns the value of attribute composer.
20 21 22 |
# File 'lib/attestor/policy/negator.rb', line 20 def composer @composer end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
20 21 22 |
# File 'lib/attestor/policy/negator.rb', line 20 def policy @policy end |
Instance Method Details
#not(*policies) ⇒ Object
16 17 18 |
# File 'lib/attestor/policy/negator.rb', line 16 def not(*policies) composer.new policy, policies.flat_map(&Not.method(:new)) end |