Class: Policy::Base::Node Private
- Inherits:
-
Object
- Object
- Policy::Base::Node
- Includes:
- Policy::Base
- Defined in:
- lib/policy/base/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
Instance Attribute Summary collapse
-
#policies ⇒ Array<Policy::Base>
readonly
private
The parts of the composite policy.
Class Method Summary collapse
-
.initialize(*policies) ⇒ Policy::Base::Node
private
Creates the node (composite policy) from its parts.
Instance Method Summary collapse
-
#new(*policies) ⇒ Policy::Base::Node
Creates the node (composite policy) from its parts.
-
#valid? ⇒ false
abstract
private
Validates a composed policy and picks errors from its parts.
Methods included from Policy::Base
Instance Attribute Details
#policies ⇒ 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 parts of the composite policy
28 29 30 |
# File 'lib/policy/base/node.rb', line 28 def policies @policies end |
Class Method Details
.initialize(*policies) ⇒ Policy::Base::Node
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.
Creates the node (composite policy) from its parts
20 21 22 |
# File 'lib/policy/base/node.rb', line 20 def initialize(*policies) @policies = policies end |
Instance Method Details
#new(*policies) ⇒ Policy::Base::Node
Creates the node (composite policy) from its parts
20 21 22 |
# File 'lib/policy/base/node.rb', line 20 def initialize(*policies) @policies = policies end |
#valid? ⇒ false
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 a composed policy and picks errors from its parts
34 35 36 37 38 39 |
# File 'lib/policy/base/node.rb', line 34 def valid? errors.clear yield # returns true if a composition valid policies.each(&method(:pick_errors_from)) false end |