Class: Attestor::Policy::Node Private
- Inherits:
-
Object
- Object
- Attestor::Policy::Node
- Includes:
- Attestor::Policy, Enumerable
- Defined in:
- lib/attestor/policy/node.rb
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.
The base class for composite policies
Class Attribute Summary collapse
-
.branches ⇒ Array<Policy::Base>
readonly
private
The branches of the node.
Class Method Summary collapse
-
.each ⇒ Enumerator
private
Iterates throught branches.
- .initialize(*branches) ⇒ Object private
-
.new(*branches) ⇒ Policy::Base::Node
Creates the node with branches.
-
.validate ⇒ undefined
private
Validates the policy as invalid.
Methods included from Attestor::Policy
#and, included, #invalid?, #not, #or, #valid?, #xor
Methods included from Validations::ClassMethods
#validate, #validates, #validators
Methods included from Factory
Methods included from Validations
Class Attribute Details
.branches ⇒ Array<Policy::Base> (readonly)
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.
The branches of the node
32 33 34 |
# File 'lib/attestor/policy/node.rb', line 32 def branches @branches end |
Class Method Details
.each ⇒ Enumerator
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.
Iterates throught branches
48 49 50 |
# File 'lib/attestor/policy/node.rb', line 48 def each block_given? ? branches.each { |item| yield(item) } : to_enum end |
.initialize(*branches) ⇒ Object
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.
23 24 25 26 |
# File 'lib/attestor/policy/node.rb', line 23 def initialize(*branches) @branches = branches.flatten freeze end |
.new(*branches) ⇒ Policy::Base::Node
Creates the node with branches
|
# File 'lib/attestor/policy/node.rb', line 14
|
.validate ⇒ undefined
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.
Validates the policy as invalid
To be reloaded by subclasses (And, Or, Xor, Not)
41 42 43 |
# File 'lib/attestor/policy/node.rb', line 41 def validate invalid :base end |